MCPcopy Create free account
hub / github.com/dcos/dcos-cli / test_plugin_verbosity

Function test_plugin_verbosity

tests/integration/test_plugin.py:176–214  ·  view source on GitHub ↗
(default_cluster)

Source from the content-addressed store, hash-verified

174
175
176def test_plugin_verbosity(default_cluster):
177 _install_test_plugin()
178
179 fixtures = [
180 {
181 'cmd': ['dcos', 'test'],
182 'DCOS_VERBOSITY': None,
183 'DCOS_LOG_LEVEL': None,
184 },
185 {
186 'cmd': ['dcos', '-v', 'test'],
187 'DCOS_VERBOSITY': '1',
188 'DCOS_LOG_LEVEL': 'info',
189 },
190 {
191 'cmd': ['dcos', '-vv', 'test'],
192 'DCOS_VERBOSITY': '2',
193 'DCOS_LOG_LEVEL': 'debug',
194 },
195 {
196 'cmd': ['dcos', '--log-level=debug', 'test'],
197 'DCOS_VERBOSITY': '2',
198 'DCOS_LOG_LEVEL': 'debug',
199 },
200 {
201 'cmd': ['dcos', '--debug', 'test'],
202 'DCOS_VERBOSITY': '2',
203 'DCOS_LOG_LEVEL': 'debug',
204 },
205 ]
206
207 for fixture in fixtures:
208 code, out, _ = exec_cmd(fixture['cmd'])
209 assert code == 0
210 out = json.loads(out)
211
212 assert out['args'][1:] == ['test']
213 assert out['env'].get('DCOS_VERBOSITY') == fixture['DCOS_VERBOSITY']
214 assert out['env'].get('DCOS_LOG_LEVEL') == fixture['DCOS_LOG_LEVEL']
215
216
217def test_plugin_exit_code(default_cluster):

Callers

nothing calls this directly

Calls 2

_install_test_pluginFunction · 0.85
exec_cmdFunction · 0.85

Tested by

no test coverage detected