mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-27 23:35:01 +00:00
Select the Calico parser and mapper by file type 🟥
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
75c561e9db
commit
a6b782d5b3
2 changed files with 23 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ from pydantic import BaseModel
|
|||
class ConditionFileType(Enum):
|
||||
LBWF = "LBWF"
|
||||
Peabody = "Peabody"
|
||||
Calico = "Calico"
|
||||
# TODO: make these asset management systems rather than client names
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import pytest
|
|||
|
||||
from applications.condition.condition_trigger_request import ConditionFileType
|
||||
from infrastructure.condition.lookups.uprn_lookup_csv import UprnLookupLocal
|
||||
from applications.condition.factory import select_parser
|
||||
from applications.condition.factory import select_parser, select_mapper
|
||||
|
||||
|
||||
def test_selects_lbwf_parser():
|
||||
|
|
@ -28,3 +28,24 @@ def test_selects_peabody_parser():
|
|||
|
||||
# assert
|
||||
assert expected_class_name == actual_class_name
|
||||
|
||||
|
||||
def test_selects_calico_parser():
|
||||
# arrange
|
||||
uprn_lookup = UprnLookupLocal(csv_path="test")
|
||||
|
||||
# act
|
||||
actual_class_name = select_parser(
|
||||
ConditionFileType.Calico, uprn_lookup
|
||||
).__class__.__name__
|
||||
|
||||
# assert
|
||||
assert actual_class_name == "CalicoParser"
|
||||
|
||||
|
||||
def test_selects_calico_mapper():
|
||||
# act
|
||||
actual_class_name = select_mapper(ConditionFileType.Calico).__class__.__name__
|
||||
|
||||
# assert
|
||||
assert actual_class_name == "CalicoMapper"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue