Created
April 3, 2018 20:33
-
-
Save jasperla/2b8b094e78f48d034336bd57c94f6c1a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Traceback (most recent call last): | |
File "/Users/jasperla/hack/salt/salt/tests/unit/modules/test_state.py", line 376, in test_low | |
"name": "vi"}), list) | |
File "/Users/jasperla/hack/salt/salt/salt/modules/state.py", line 448, in low | |
st_ = salt.state.State(__opts__, proxy=__proxy__) | |
File "/Users/jasperla/hack/salt/salt/salt/state.py", line 727, in __init__ | |
self.opts['pillar'] = self._gather_pillar() | |
File "/Users/jasperla/hack/salt/salt/salt/state.py", line 784, in _gather_pillar | |
self.opts['id'], | |
KeyError: 'id' | |
====================================================================== | |
ERROR: test_high (unit.modules.test_state.StateTestCase) | |
[CPU:0.0%|MEM:63.8%] | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/Users/jasperla/hack/salt/salt/tests/unit/modules/test_state.py", line 462, in test_high | |
self.assertTrue(state.high({"vim": {"pkg": ["installed"]}})) | |
File "/Users/jasperla/hack/salt/salt/salt/modules/state.py", line 515, in high | |
initial_pillar=_get_initial_pillar(opts)) | |
TypeError: __init__() got an unexpected keyword argument 'proxy' | |
====================================================================== | |
ERROR: test_low (unit.modules.test_state.StateTestCase) | |
[CPU:0.0%|MEM:63.8%] | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/Users/jasperla/hack/salt/salt/tests/unit/modules/test_state.py", line 446, in test_low | |
"name": "vi"}), list) | |
File "/Users/jasperla/hack/salt/salt/salt/modules/state.py", line 448, in low | |
st_ = salt.state.State(__opts__, proxy=__proxy__) | |
TypeError: __init__() got an unexpected keyword argument 'proxy' | |
====================================================================== | |
ERROR: test_single (unit.modules.test_state.StateTestCase) | |
[CPU:0.0%|MEM:63.8%] | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/Users/jasperla/hack/salt/salt/tests/unit/modules/test_state.py", line 588, in test_single | |
"name=vim")) | |
File "/Users/jasperla/hack/salt/salt/salt/modules/state.py", line 2013, in single | |
initial_pillar=_get_initial_pillar(opts)) | |
TypeError: __init__() got an unexpected keyword argument 'proxy' | |
====================================================================== | |
ERROR: test_template_str (unit.modules.test_state.StateTestCase) | |
[CPU:0.0%|MEM:63.8%] | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/Users/jasperla/hack/salt/salt/tests/unit/modules/test_state.py", line 488, in test_template_str | |
self.assertTrue(state.template_str('Template String')) | |
File "/Users/jasperla/hack/salt/salt/salt/modules/state.py", line 598, in template_str | |
initial_pillar=_get_initial_pillar(opts)) | |
TypeError: __init__() got an unexpected keyword argument 'proxy' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@skipIf(NO_MOCK, NO_MOCK_REASON) | |
class StateNoCallTestCase(TestCase, LoaderModuleMockMixin): | |
''' | |
Test case for salt.modules.state | |
''' | |
def setup_loader_modules(self): | |
utils = salt.loader.utils( | |
salt.config.DEFAULT_MINION_OPTS, | |
whitelist=['state'] | |
) | |
utils.keys() | |
return { | |
state: { | |
'__opts__': { | |
'cachedir': '/D', | |
'saltenv': None, | |
'__cli': 'salt', | |
'extension_modules': 'ext_modules', | |
}, | |
'__utils__': utils, | |
'__salt__': { | |
'config.get': config.get, | |
}, | |
'__proxy__': None, | |
}, | |
config: { | |
'__opts__': {}, | |
'__pillar__': {}, | |
}, | |
} | |
def test_low(self): | |
''' | |
Test of executing a single low data call | |
''' | |
mock = MagicMock(side_effect=[False, None, None]) | |
with patch.object(state, '_check_queue', mock): | |
self.assertFalse(state.low({"state": "pkg", "fun": "installed", | |
"name": "vi"})) | |
MockState.State.flag = False | |
self.assertEqual(state.low({"state": "pkg", "fun": "installed", | |
"name": "vi"}), list) | |
MockState.State.flag = True | |
self.assertTrue(state.low({"state": "pkg", "fun": "installed", | |
"name": "vi"})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment