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

Function test_plugin_invocation

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

Source from the content-addressed store, hash-verified

97
98
99def 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")

Callers

nothing calls this directly

Calls 2

_install_test_pluginFunction · 0.85
exec_cmdFunction · 0.85

Tested by

no test coverage detected