mirror of
https://github.com/fhswf/aki_prj23_transparenzregister.git
synced 2025-06-22 08:33:54 +02:00
feat(data-extraction): Extract c/o relation from street in company relation
This commit is contained in:
@ -709,6 +709,38 @@ def test_map_last_update() -> None:
|
||||
assert result == date
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("value", "expected_result"),
|
||||
[
|
||||
(
|
||||
{
|
||||
"location": Location(
|
||||
"", "c/o Youco24 Business Center, Abc ffda", None, None
|
||||
),
|
||||
"relationships": [],
|
||||
},
|
||||
{
|
||||
"location": Location("", "Abc ffda", None, None),
|
||||
"relationships": [
|
||||
CompanyToCompanyRelationship(
|
||||
RelationshipRoleEnum.LOKATION_BEI, # type: ignore
|
||||
Location("", "Abc ffda", None, None),
|
||||
CompanyRelationshipEnum.COMPANY,
|
||||
"Youco24 Business Center",
|
||||
)
|
||||
],
|
||||
},
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_map_co_relation(value: dict, expected_result: dict) -> None:
|
||||
result = transform.map_co_relation(value)
|
||||
assert result == expected_result
|
||||
|
||||
|
||||
@patch(
|
||||
"aki_prj23_transparenzregister.utils.data_extraction.unternehmensregister.transform.map_co_relation"
|
||||
)
|
||||
@patch(
|
||||
"aki_prj23_transparenzregister.utils.data_extraction.unternehmensregister.transform.map_company_id"
|
||||
)
|
||||
@ -746,6 +778,7 @@ def test_map_unternehmensregister_json( # noqa: PLR0913
|
||||
mock_loc_from_beteiligung: Mock,
|
||||
mock_map_name_from_beteiligung: Mock,
|
||||
mock_map_company_id: Mock,
|
||||
mock_map_co_relation: Mock,
|
||||
) -> None:
|
||||
expected_result = Company(
|
||||
**{ # type: ignore
|
||||
@ -770,6 +803,7 @@ def test_map_unternehmensregister_json( # noqa: PLR0913
|
||||
mock_map_business_purpose.return_value = expected_result.business_purpose
|
||||
mock_map_founding_date.return_value = expected_result.founding_date
|
||||
mock_map_parse_stakeholder.return_value = expected_result.relationships[0]
|
||||
mock_map_co_relation.side_effect = lambda x: x
|
||||
|
||||
data: dict = {
|
||||
"XJustiz_Daten": {
|
||||
|
Reference in New Issue
Block a user