shared: implementazione package identity
Continuous Integration / Quality Assurance (push) Canceled after 0s
Continuous Integration / Quality Assurance (push) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
"""
|
||||
Tests for the SessionId Value Object.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from shared.identity import Identifier, SessionId
|
||||
|
||||
|
||||
def test_new_creates_module_id() -> None:
|
||||
"""A new SessionId should be created."""
|
||||
|
||||
# Arrange
|
||||
|
||||
# Act
|
||||
module_id = SessionId.new()
|
||||
|
||||
# Assert
|
||||
assert isinstance(module_id, SessionId)
|
||||
|
||||
|
||||
def test_module_id_is_identifier() -> None:
|
||||
"""SessionId should inherit from Identifier."""
|
||||
|
||||
# Arrange
|
||||
|
||||
# Act
|
||||
module_id = SessionId.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 = SessionId.new()
|
||||
|
||||
# Assert
|
||||
assert type(module_id) is SessionId
|
||||
Reference in New Issue
Block a user