Пример #1
0
    def test_file_list_root(self):
        '''
        Test if it list the files that belong to a package, using the
        root parameter.
        '''

        mock = MagicMock(return_value='')
        with patch.dict(rpm.__salt__, {'cmd.run': mock}):
            rpm.file_list('httpd', root='/')
            self.assertTrue(_called_with_root(mock))
Пример #2
0
    def test_file_list_root(self):
        """
        Test if it list the files that belong to a package, using the
        root parameter.
        """

        mock = MagicMock(return_value="")
        with patch.dict(rpm.__salt__, {"cmd.run": mock}):
            rpm.file_list("httpd", root="/")
            self.assertTrue(_called_with_root(mock))
Пример #3
0
 def test_file_list(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_list('httpd'),
                              {'errors': [], 'files': []})
Пример #4
0
 def test_file_list(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_list("httpd"), {"errors": [], "files": []})
         self.assertFalse(_called_with_root(mock))
Пример #5
0
def test_file_list():
    """
    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_list("httpd") == {"errors": [], "files": []}
        assert not _called_with_root(mock)