(default_cluster)
| 174 | |
| 175 | |
| 176 | def 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 | |
| 217 | def test_plugin_exit_code(default_cluster): |
nothing calls this directly
no test coverage detected