Test executing master_call with lowdata The choice of using key.list_all for this is arbitrary and should be changed to some mocked function that is more testing friendly.
(client, client_config, auth_creds, salt_auto_account)
| 31 | |
| 32 | |
| 33 | def test_token(client, client_config, auth_creds, salt_auto_account): |
| 34 | """ |
| 35 | Test executing master_call with lowdata |
| 36 | |
| 37 | The choice of using key.list_all for this is arbitrary and should be |
| 38 | changed to some mocked function that is more testing friendly. |
| 39 | """ |
| 40 | auth = salt.auth.LoadAuth(client_config) |
| 41 | token = auth.mk_token(auth_creds) |
| 42 | |
| 43 | ret = client.master_call( |
| 44 | **{ |
| 45 | "client": "wheel", |
| 46 | "fun": "key.list_all", |
| 47 | "token": token["token"], |
| 48 | "print_event": False, |
| 49 | } |
| 50 | ) |
| 51 | assert ret |
| 52 | assert "data" in ret |
| 53 | data = ret["data"] |
| 54 | assert data["success"] is True |
| 55 | assert data["user"] == salt_auto_account.username |
| 56 | assert data["fun"] == "wheel.key.list_all" |
| 57 | assert data["return"] |
| 58 | master_id = client.opts["id"].removesuffix("_master") |
| 59 | assert data["return"]["local"] == [f"{master_id}.pem", f"{master_id}.pub"] |
| 60 | |
| 61 | |
| 62 | def test_cmd_sync(client, auth_creds, salt_auto_account): |
nothing calls this directly
no test coverage detected