def test_secret_to_api(): "Secrets are properly output to the API, including the actual secret value" secret = Secret("my-secret", {"password": "******"}) assert secret.to_api() == { "expires": FOREVER, "secret": { "password": "******" } }
def test_secret_to_api_no_secret(): "A secret with no value is not output to the API" secret = Secret("my-secret") with pytest.raises(ValueError): secret.to_api()