#NEWLINE# @ mock . patch . object ( partitioning , 'os' , autospec = True ) #NEWLINE# @ mock . patch . object ( partitioning , 'utils' , autospec = True ) #NEWLINE# @ mock . patch . object ( partitioning , 'mu' , autospec = True ) #NEWLINE# @ mock . patch . object ( partitioning , 'lu' , autospec = True ) #NEWLINE# @ mock . patch . object ( partitioning , 'fu' , autospec = True ) #NEWLINE# @ mock . patch . object ( partitioning , 'pu' , autospec = True ) #NEWLINE# def test_do_partitioning( self , mock_pu , mock_fu , mock_lu , mock_mu , mock_utils , mock_os ) : #NEWLINE# #INDENT# mock_os . path . exists . return_value = True #NEWLINE# self . action . execute ( ) #NEWLINE# mock_utils . unblacklist_udev_rules . assert_called_once_with ( udev_rules_dir = '/etc/udev/rules.d' , udev_rename_substr = '.renamedrule' ) #NEWLINE# mock_utils . blacklist_udev_rules . assert_called_once_with ( udev_rules_dir = '/etc/udev/rules.d' , udev_rules_lib_dir = '/lib/udev/rules.d' , udev_empty_rule = 'empty_rule' , udev_rename_substr = '.renamedrule' ) #NEWLINE# mock_pu_ml_expected_calls = [ mock . call ( '/dev/sda' , 'gpt' ) , mock . call ( '/dev/sdb' , 'gpt' ) , mock . call ( '/dev/sdc' , 'gpt' ) ] #NEWLINE# self . assertEqual ( mock_pu_ml_expected_calls , mock_pu . make_label . call_args_list ) #NEWLINE# mock_pu_mp_expected_calls = [ mock . call ( '/dev/sda' , 1 , 25 , 'primary' ) , mock . call ( '/dev/sda' , 25 , 225 , 'primary' ) , mock . call ( '/dev/sda' , 225 , 425 , 'primary' ) , mock . call ( '/dev/sda' , 425 , 625 , 'primary' ) , mock . call ( '/dev/sda' , 625 , 20063 , 'primary' ) , mock . call ( '/dev/sda' , 20063 , 65660 , 'primary' ) , mock . call ( '/dev/sda' , 65660 , 65680 , 'primary' ) , mock . call ( '/dev/sdb' , 1 , 25 , 'primary' ) , mock . call ( '/dev/sdb' , 25 , 225 , 'primary' ) , mock . call ( '/dev/sdb' , 225 , 65196 , 'primary' ) , mock . call ( '/dev/sdc' , 1 , 25 , 'primary' ) , mock . call ( '/dev/sdc' , 25 , 225 , 'primary' ) , mock . call ( '/dev/sdc' , 225 , 65196 , 'primary' ) ] #NEWLINE# self . assertEqual ( mock_pu_mp_expected_calls , mock_pu . make_partition . call_args_list ) #NEWLINE# mock_pu_spf_expected_calls = [ mock . call ( '/dev/sda' , 1 , 'bios_grub' ) , mock . call ( '/dev/sdb' , 1 , 'bios_grub' ) , mock . call ( '/dev/sdc' , 1 , 'bios_grub' ) ] #NEWLINE# self . assertEqual ( mock_pu_spf_expected_calls , mock_pu . set_partition_flag . call_args_list ) #NEWLINE# mock_pu_sgt_expected_calls = [ mock . call ( '/dev/sda' , 4 , 'fake_guid' ) ] #NEWLINE# self . assertEqual ( mock_pu_sgt_expected_calls , mock_pu . set_gpt_type . call_args_list ) #NEWLINE# mock_lu_p_expected_calls = [ mock . call ( '/dev/sda5' , metadatasize = 28 , metadatacopies = 2 ) , mock . call ( '/dev/sda6' , metadatasize = 28 , metadatacopies = 2 ) , mock . call ( '/dev/sdb3' , metadatasize = 28 , metadatacopies = 2 ) , mock . call ( '/dev/sdc3' , metadatasize = 28 , metadatacopies = 2 ) ] #NEWLINE# self . assertEqual ( mock_lu_p_expected_calls , mock_lu . pvcreate . call_args_list ) #NEWLINE# mock_lu_v_expected_calls = [ mock . call ( 'os' , '/dev/sda5' ) , mock . call ( 'image' , '/dev/sda6' , '/dev/sdb3' , '/dev/sdc3' ) ] #NEWLINE# self . assertEqual ( mock_lu_v_expected_calls , mock_lu . vgcreate . call_args_list ) #NEWLINE# mock_lu_l_expected_calls = [ mock . call ( 'os' , 'root' , 15360 ) , mock . call ( 'os' , 'swap' , 4014 ) , mock . call ( 'image' , 'glance' , 175347 ) ] #NEWLINE# self . assertEqual ( mock_lu_l_expected_calls , mock_lu . lvcreate . call_args_list ) #NEWLINE# mock_fu_mf_expected_calls = [ mock . call ( 'ext2' , '' , '' , '/dev/sda3' ) , mock . call ( 'ext2' , '' , '' , '/dev/sda4' ) , mock . call ( 'swap' , '' , '' , '/dev/mapper/os-swap' ) , mock . call ( 'xfs' , '' , '' , '/dev/mapper/image-glance' ) ] #NEWLINE# self . assertEqual ( mock_fu_mf_expected_calls , mock_fu . make_fs . call_args_list )