예제 #1
0
    def test_held(self):
        '''
        Test to set package in 'hold' state, meaning it will not be upgraded.
        '''
        name = 'tmux'

        ret = {'name': name,
               'result': False,
               'changes': {},
               'comment': 'Package {0} does not have a state'.format(name)}

        mock = MagicMock(return_value=False)
        with patch.dict(aptpkg.__salt__, {'pkg.get_selections': mock}):
            self.assertDictEqual(aptpkg.held(name), ret)
예제 #2
0
파일: apt_test.py 프로젝트: DaveQB/salt
    def test_held(self):
        '''
        Test to set package in 'hold' state, meaning it will not be upgraded.
        '''
        name = 'tmux'

        ret = {'name': name,
               'result': False,
               'changes': {},
               'comment': 'Package {0} does not have a state'.format(name)}

        mock = MagicMock(return_value=False)
        with patch.dict(aptpkg.__salt__, {'pkg.get_selections': mock}):
            self.assertDictEqual(aptpkg.held(name), ret)
예제 #3
0
def test_held():
    """
    Test to set package in 'hold' state, meaning it will not be upgraded.
    """
    name = "tmux"

    ret = {
        "name": name,
        "result": False,
        "changes": {},
        "comment": "Package {} does not have a state".format(name),
    }

    mock = MagicMock(return_value=False)
    with patch.dict(aptpkg.__salt__, {"pkg.get_selections": mock}):
        assert aptpkg.held(name) == ret