예제 #1
0
 def test_remove_single_package(self):
     fake_run = Mock()
     with patch(self.to_patch, fake_run):
         pkg_managers.DNF(Mock()).remove('vim')
         result = fake_run.call_args_list[-1]
     assert 'remove' in result[0][-1]
     assert result[0][-1][-1] == 'vim'
예제 #2
0
 def test_install_multiple_packages(self):
     fake_run = Mock()
     with patch(self.to_patch, fake_run):
         pkg_managers.DNF(Mock()).install(['vim', 'zsh'])
         result = fake_run.call_args_list[-1]
     assert 'install' in result[0][-1]
     assert result[0][-1][-2:] == ['vim', 'zsh']
예제 #3
0
def get_packager(module):
    if module.normalized_release.int_major >= 22:
        return pkg_managers.DNF(module)
    else:
        return pkg_managers.Yum(module)
예제 #4
0
 def test_remove_multiple_packages(self):
     fake_run = Mock()
     with patch(self.to_patch, fake_run):
         pkg_managers.DNF(Mock()).remove(['vim', 'zsh'])
         result = fake_run.call_args_list[-1]
     assert 'remove' in result[0][-1]