Model/backend/condition/tests/parsing/test_parsing_factory.py
2026-02-04 14:59:16 +00:00

30 lines
834 B
Python

import pytest
from backend.condition.condition_trigger_request import ConditionFileType
from backend.condition.lookups.uprn_lookup_csv import UprnLookupLocal
from backend.condition.parsing.factory import select_parser
def test_selects_lbwf_parser():
# arrange
file_type = ConditionFileType.LBWF
expected_class_name = "LbwfParser"
# act
actual_class_name = select_parser(file_type).__class__.__name__
# assert
assert expected_class_name == actual_class_name
def test_selects_peabody_parser():
# arrange
file_type = ConditionFileType.Peabody
expected_class_name = "PeabodyParser"
uprn_lookup = UprnLookupLocal(csv_path="test")
# act
actual_class_name = select_parser(file_type, uprn_lookup).__class__.__name__
# assert
assert expected_class_name == actual_class_name