コード例 #1
0
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": "******"
        }
    }
コード例 #2
0
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()