mirror of
https://github.com/fhswf/aki_prj23_transparenzregister.git
synced 2025-05-12 16:30:06 +02:00
refactor: Adapt to extended unit tests
This commit is contained in:
parent
fd47487367
commit
f1474feaf8
@ -505,16 +505,16 @@ def map_co_relation(data: dict) -> dict:
|
||||
trimmed_part = part.strip()
|
||||
result = re.findall(r"^c\/o(.*)$", trimmed_part)
|
||||
if len(result) == 1:
|
||||
co_company = result[0]
|
||||
co_company = result[0].strip()
|
||||
co_company_index = index
|
||||
if co_company_index is not None:
|
||||
del parts[co_company_index]
|
||||
street = "".join(parts).strip()
|
||||
data["location"].street = street
|
||||
|
||||
if co_company is not None:
|
||||
if co_company is not None and co_company != "":
|
||||
relation = CompanyToCompanyRelationship(
|
||||
RelationshipRoleEnum.LOKATION_BEI, # type: ignore
|
||||
RelationshipRoleEnum.CARE_OF, # type: ignore
|
||||
Location(
|
||||
data["location"].city,
|
||||
street,
|
||||
|
@ -723,7 +723,7 @@ def test_map_last_update() -> None:
|
||||
"location": Location("", "Abc ffda", None, None),
|
||||
"relationships": [
|
||||
CompanyToCompanyRelationship(
|
||||
RelationshipRoleEnum.LOKATION_BEI, # type: ignore
|
||||
RelationshipRoleEnum.CARE_OF, # type: ignore
|
||||
Location("", "Abc ffda", None, None),
|
||||
CompanyRelationshipEnum.COMPANY,
|
||||
"Youco24 Business Center",
|
||||
@ -734,7 +734,7 @@ def test_map_last_update() -> None:
|
||||
(
|
||||
{
|
||||
"location": Location(
|
||||
"", "c/o Youco24 Business Center, Abc Str.", "42", "58644"
|
||||
"Iserlohn", "c/o Youco24 Business Center, Abc Str.", "42", "58644"
|
||||
),
|
||||
"relationships": [],
|
||||
},
|
||||
@ -742,8 +742,8 @@ def test_map_last_update() -> None:
|
||||
"location": Location("Iserlohn", "Abc Str.", "42", "58644"),
|
||||
"relationships": [
|
||||
CompanyToCompanyRelationship(
|
||||
RelationshipRoleEnum.LOKATION_BEI, # type: ignore
|
||||
Location("Iserlohn", "Abc ffda", "42", "58644"),
|
||||
RelationshipRoleEnum.CARE_OF, # type: ignore
|
||||
Location("Iserlohn", "Abc Str.", "42", "58644"),
|
||||
CompanyRelationshipEnum.COMPANY,
|
||||
"Youco24 Business Center",
|
||||
)
|
||||
@ -753,7 +753,7 @@ def test_map_last_update() -> None:
|
||||
(
|
||||
{
|
||||
"location": Location(
|
||||
"Iserlohn", "Abc Str. 42, c/o Youco24 Business Center", None, "58644"
|
||||
"Iserlohn", "Abc Str., c/o Youco24 Business Center", "42", "58644"
|
||||
),
|
||||
"relationships": [],
|
||||
},
|
||||
@ -761,8 +761,8 @@ def test_map_last_update() -> None:
|
||||
"location": Location("Iserlohn", "Abc Str.", "42", "58644"),
|
||||
"relationships": [
|
||||
CompanyToCompanyRelationship(
|
||||
RelationshipRoleEnum.LOKATION_BEI, # type: ignore
|
||||
Location("Iserlohn", "Abc ffda", "42", "58644"),
|
||||
RelationshipRoleEnum.CARE_OF, # type: ignore
|
||||
Location("Iserlohn", "Abc Str.", "42", "58644"),
|
||||
CompanyRelationshipEnum.COMPANY,
|
||||
"Youco24 Business Center",
|
||||
)
|
||||
@ -771,9 +771,7 @@ def test_map_last_update() -> None:
|
||||
),
|
||||
(
|
||||
{
|
||||
"location": Location(
|
||||
"Iserlohn", "Abc Str. 42, c/o", None, "58644"
|
||||
),
|
||||
"location": Location("Iserlohn", "Abc Str., c/o", "42", "58644"),
|
||||
"relationships": [],
|
||||
},
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user