@@ -25,7 +25,6 @@ def setUp(self):
2525 'friendly_release_name' : mock .sentinel .friendly_release_name ,
2626 }
2727 self .package_names = ['package1' , 'package2' ]
28- self .enable_repos = ['repo1' , 'repo2' ]
2928 self .event_manager = mock .MagicMock ()
3029 self .morphing_tools = redhat .BaseRedHatMorphingTools (
3130 mock .sentinel .conn , mock .sentinel .os_root_dir ,
@@ -325,11 +324,10 @@ def test_get_installed_packages_none(self, mock_exec_cmd_chroot):
325324
326325 @mock .patch .object (base .BaseLinuxOSMorphingTools , '_exec_cmd_chroot' )
327326 def test__yum_install (self , mock_exec_cmd_chroot ):
328- self .morphing_tools ._yum_install (self .package_names , self . enable_repos )
327+ self .morphing_tools ._yum_install (self .package_names )
329328
330329 mock_exec_cmd_chroot .assert_called_once_with (
331- "yum install package1 package2 -y "
332- "--enablerepo=repo1 --enablerepo=repo2"
330+ "yum install package1 package2 -y"
333331 )
334332
335333 @mock .patch .object (base .BaseLinuxOSMorphingTools , '_exec_cmd_chroot' )
@@ -339,7 +337,7 @@ def test__yum_install_with_exception(self, mock_exec_cmd_chroot):
339337 self .assertRaises (
340338 exception .FailedPackageInstallationException ,
341339 self .morphing_tools ._yum_install ,
342- self .package_names , self . enable_repos
340+ self .package_names
343341 )
344342
345343 @mock .patch .object (base .BaseLinuxOSMorphingTools , '_exec_cmd_chroot' )
@@ -383,33 +381,6 @@ def test__yum_clean_all_path_not_exists(self, mock_test_path,
383381
384382 mock_exec_cmd_chroot .assert_called_once_with ("yum clean all" )
385383
386- @mock .patch .object (base .BaseLinuxOSMorphingTools , '_list_dir' )
387- @mock .patch .object (base .BaseLinuxOSMorphingTools , '_read_file_sudo' )
388- def test__find_yum_repos_found (self , mock_read_file_sudo , mock_list_dir ):
389- mock_list_dir .return_value = ['file1.repo' , 'file2.repo' ]
390- mock_read_file_sudo .return_value = b'[repo1]\n [repo2]'
391- repos_to_enable = ['repo1' ]
392-
393- result = self .morphing_tools ._find_yum_repos (repos_to_enable )
394-
395- mock_read_file_sudo .assert_has_calls ([
396- mock .call ('etc/yum.repos.d/file1.repo' ),
397- mock .call ('etc/yum.repos.d/file2.repo' )
398- ])
399-
400- self .assertEqual (result , ['repo1' ])
401-
402- @mock .patch .object (base .BaseLinuxOSMorphingTools , '_list_dir' )
403- @mock .patch .object (base .BaseLinuxOSMorphingTools , '_read_file_sudo' )
404- def test__find_yum_repos_not_found (self , mock_read_file_sudo ,
405- mock_list_dir ):
406- mock_list_dir .return_value = ['file1.repo' , 'file2.repo' ]
407- mock_read_file_sudo .return_value = b'[repo1]\n [repo2]'
408- repos_to_enable = ['repo3' ]
409-
410- with self .assertLogs ('coriolis.osmorphing.redhat' , level = logging .WARN ):
411- self .morphing_tools ._find_yum_repos (repos_to_enable )
412-
413384 @mock .patch .object (redhat .BaseRedHatMorphingTools , '_yum_install' )
414385 @mock .patch .object (redhat .BaseRedHatMorphingTools , '_yum_clean_all' )
415386 @mock .patch .object (base .BaseLinuxOSMorphingTools , 'pre_packages_install' )
@@ -450,14 +421,10 @@ def test_post_packages_install(
450421 mock_post_packages_install .assert_called_once_with (self .package_names )
451422
452423 @mock .patch .object (redhat .BaseRedHatMorphingTools , '_yum_install' )
453- @mock .patch .object (redhat .BaseRedHatMorphingTools , '_get_repos_to_enable' )
454- def test_install_packages (self , mock_get_repos_to_enable ,
455- mock_yum_install ):
424+ def test_install_packages (self , mock_yum_install ):
456425 self .morphing_tools .install_packages (self .package_names )
457426
458- mock_get_repos_to_enable .assert_called_once ()
459- mock_yum_install .assert_called_once_with (
460- self .package_names , mock_get_repos_to_enable .return_value )
427+ mock_yum_install .assert_called_once_with (self .package_names )
461428
462429 @mock .patch .object (redhat .BaseRedHatMorphingTools , '_yum_uninstall' )
463430 def test_uninstall_packages (self , mock_yum_uninstall ):
0 commit comments