Beispiel #1
0
def test_repository_name():
    repository = dummy_repository_base()
    repository.data.full_name = "test/TEST-REPOSITORY-NAME"
    repository.data.full_name_lower = "test/TEST-REPOSITORY-NAME".lower()
    repository.repository_manifest = HacsManifest.from_dict({})

    name = get_repository_name(repository)
    assert name == "Test Repository Name"
Beispiel #2
0
def test_integration_manifest():
    repository = dummy_repository_base()
    repository.data.category = "integration"
    repository.data.full_name = "test/TEST-REPOSITORY-NAME"
    repository.data.full_name_lower = "test/TEST-REPOSITORY-NAME".lower()
    repository.repository_manifest = HacsManifest.from_dict({})
    repository.integration_manifest = {"name": "TEST-MANIFEST"}

    name = get_repository_name(repository)
    assert name == "TEST-MANIFEST"
Beispiel #3
0
def test_everything():
    repository = dummy_repository_base()
    repository.data.full_name = "test/TEST-REPOSITORY-NAME"
    repository.data.full_name_lower = "test/TEST-REPOSITORY-NAME".lower()
    repository.repository_manifest = HacsManifest.from_dict(
        {"name": "TEST-HACS_MANIFEST"}
    )
    repository.integration_manifest = {"name": "TEST-MANIFEST"}

    for category in ELEMENT_TYPES:
        repository.data.category = category
        name = get_repository_name(repository)
        assert name == "TEST-HACS_MANIFEST"
 def display_name(self):
     """Return display name."""
     return get_repository_name(self)