def test_secret_from_api(): "Secrets are properly read from a Taskcluster API result" api_result = { "expires": datetime.datetime(3000, 1, 1, 0, 0, 0), "secret": { "password": "******" }, } secret = Secret.from_api("my-secret", api_result) assert secret.name == "my-secret" assert secret.secret == {"password": "******"}
def test_secret_from_api_no_secret(): "Secrets are properly read from a Taskcluster API result" secret = Secret.from_api("my-secret") assert secret.name == "my-secret" assert secret.secret == NoSecret