MCPcopy Create free account
hub / github.com/saltstack/salt / test_token

Function test_token

tests/pytests/integration/client/test_runner.py:35–54  ·  view source on GitHub ↗

Test executing master_call with lowdata The choice of using error.error for this is arbitrary and should be changed to some mocked function that is more testing friendly.

(client, client_config, auth_creds)

Source from the content-addressed store, hash-verified

33
34
35def test_token(client, client_config, auth_creds):
36 """
37 Test executing master_call with lowdata
38
39 The choice of using error.error for this is arbitrary and should be
40 changed to some mocked function that is more testing friendly.
41 """
42 auth = salt.auth.LoadAuth(client_config)
43 token = auth.mk_token(auth_creds)
44
45 low = {
46 "client": "runner",
47 "fun": "error.error",
48 "token": token["token"],
49 }
50 ret = client.master_call(**low)
51 assert ret
52 assert "jid" in ret
53 assert "tag" in ret
54 assert ret["tag"] == "salt/run/{}".format(ret["jid"])
55
56
57def test_cmd_sync(client, auth_creds):

Callers

nothing calls this directly

Calls 3

mk_tokenMethod · 0.95
formatMethod · 0.80
master_callMethod · 0.45

Tested by

no test coverage detected