(default_cluster)
| 97 | |
| 98 | |
| 99 | def test_plugin_invocation(default_cluster): |
| 100 | _install_test_plugin() |
| 101 | |
| 102 | args = ['dcos', 'test', 'arg1', 'arg2'] |
| 103 | code, out, err = exec_cmd(args) |
| 104 | assert code == 0 |
| 105 | out = json.loads(out) |
| 106 | |
| 107 | assert out['args'][1:] == args[1:] |
| 108 | |
| 109 | executable_path = out['env'].get('DCOS_CLI_EXECUTABLE_PATH') |
| 110 | if sys.platform == 'win32': |
| 111 | # On Windows, "shutil.which" normalizes the path so the drive letter is not present. |
| 112 | # This removes it from the value returned by the test plugin too. |
| 113 | (_, executable_path) = os.path.splitdrive(executable_path) |
| 114 | expected_executable_path = shutil.which("dcos.exe") |
| 115 | else: |
| 116 | expected_executable_path = shutil.which("dcos") |
| 117 | assert executable_path == expected_executable_path |
| 118 | |
| 119 | assert out['env'].get('DCOS_URL') == default_cluster['dcos_url'] |
| 120 | assert out['env'].get('DCOS_ACS_TOKEN') == default_cluster['acs_token'] |
| 121 | |
| 122 | |
| 123 | @pytest.mark.skip(reason="Cluster created with terraform have untrusted certificate") |
nothing calls this directly
no test coverage detected