def test_file_dict_root(self): ''' Test if it list the files that belong to a package ''' mock = MagicMock(return_value='') with patch.dict(rpm.__salt__, {'cmd.run': mock}): rpm.file_dict('httpd', root='/') self.assertTrue(_called_with_root(mock))
def test_file_dict_root(self): """ Test if it list the files that belong to a package """ mock = MagicMock(return_value="") with patch.dict(rpm.__salt__, {"cmd.run": mock}): rpm.file_dict("httpd", root="/") self.assertTrue(_called_with_root(mock))
def test_file_dict(self): ''' Test if it list the files that belong to a package ''' mock = MagicMock(return_value='') with patch.dict(rpm.__salt__, {'cmd.run': mock}): self.assertDictEqual(rpm.file_dict('httpd'), {'errors': [], 'packages': {}})
def test_file_dict(self): """ Test if it list the files that belong to a package """ mock = MagicMock(return_value="") with patch.dict(rpm.__salt__, {"cmd.run": mock}): self.assertDictEqual(rpm.file_dict("httpd"), {"errors": [], "packages": {}}) self.assertFalse(_called_with_root(mock))
def test_file_dict(): """ Test if it list the files that belong to a package """ mock = MagicMock(return_value="") with patch.dict(rpm.__salt__, {"cmd.run": mock}): assert rpm.file_dict("httpd") == {"errors": [], "packages": {}} assert not _called_with_root(mock)