示例#1
0
def test_init_from_arguments(attributes: dict):
    """Expect proper initialization from arguments."""
    settings = StructurizrClientSettings(**attributes)
    for attr, expected in attributes.items():
        value = getattr(settings, attr)
        if attr in ("api_key", "api_secret", "workspace_archive_location"):
            value = str(value)
        assert value == expected
示例#2
0
def test_init_from_dotenv(dotenv, archive_location):
    """Expect proper initialization from a `.env` file."""
    settings = StructurizrClientSettings()
    assert settings.url == "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    assert settings.workspace_id == 19
    assert str(settings.api_key) == "7f4e4edc-f61c-4ff2-97c9-ea4bc2a7c98c"
    assert str(settings.api_secret) == "ae140655-da7c-4a8d-9467-5a7d9792fca0"
    assert settings.user == "astley@localhost"
    assert settings.agent == "structurizr-python/1.0.0"
    assert str(settings.workspace_archive_location) == archive_location