44 lines
782 B
Python
44 lines
782 B
Python
"""
|
|
Tests for the ArtifactId Value Object.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from shared.identity import ArtifactId, Identifier
|
|
|
|
|
|
def test_new_creates_module_id() -> None:
|
|
"""A new ArtifactId should be created."""
|
|
|
|
# Arrange
|
|
|
|
# Act
|
|
module_id = ArtifactId.new()
|
|
|
|
# Assert
|
|
assert isinstance(module_id, ArtifactId)
|
|
|
|
|
|
def test_module_id_is_identifier() -> None:
|
|
"""ArtifactId should inherit from Identifier."""
|
|
|
|
# Arrange
|
|
|
|
# Act
|
|
module_id = ArtifactId.new()
|
|
|
|
# Assert
|
|
assert isinstance(module_id, Identifier)
|
|
|
|
|
|
def test_module_id_preserves_type() -> None:
|
|
"""Factory methods should preserve the concrete type."""
|
|
|
|
# Arrange
|
|
|
|
# Act
|
|
module_id = ArtifactId.new()
|
|
|
|
# Assert
|
|
assert type(module_id) is ArtifactId
|