"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/unit/states/test_aptpkg.py" between
salt-3002.1.tar.gz and salt-3002.2.tar.gz

About: SaltStack is a systems management software for data center automation, cloud orchestration, server provisioning, configuration management and more. Community version.

test_aptpkg.py  (salt-3002.1):test_aptpkg.py  (salt-3002.2)
# -*- coding: utf-8 -*-
""" """
:codeauthor: Jayesh Kariya <jayeshk@saltstack.com> :codeauthor: Jayesh Kariya <jayeshk@saltstack.com>
""" """
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Libs
import salt.states.aptpkg as aptpkg import salt.states.aptpkg as aptpkg
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin from tests.support.mixins import LoaderModuleMockMixin
from tests.support.mock import MagicMock, patch from tests.support.mock import MagicMock, patch
from tests.support.unit import TestCase from tests.support.unit import TestCase
class AptTestCase(TestCase, LoaderModuleMockMixin): class AptTestCase(TestCase, LoaderModuleMockMixin):
""" """
Test cases for salt.states.aptpkg Test cases for salt.states.aptpkg
""" """
def setup_loader_modules(self): def setup_loader_modules(self):
skipping to change at line 36 skipping to change at line 30
def test_held(self): def test_held(self):
""" """
Test to set package in 'hold' state, meaning it will not be upgraded. Test to set package in 'hold' state, meaning it will not be upgraded.
""" """
name = "tmux" name = "tmux"
ret = { ret = {
"name": name, "name": name,
"result": False, "result": False,
"changes": {}, "changes": {},
"comment": "Package {0} does not have a state".format(name), "comment": "Package {} does not have a state".format(name),
} }
mock = MagicMock(return_value=False) mock = MagicMock(return_value=False)
with patch.dict(aptpkg.__salt__, {"pkg.get_selections": mock}): with patch.dict(aptpkg.__salt__, {"pkg.get_selections": mock}):
self.assertDictEqual(aptpkg.held(name), ret) self.assertDictEqual(aptpkg.held(name), ret)
 End of changes. 5 change blocks. 
7 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)