mirror of
https://github.com/fhswf/aki_prj23_transparenzregister.git
synced 2025-05-12 19:10:01 +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()
|
trimmed_part = part.strip()
|
||||||
result = re.findall(r"^c\/o(.*)$", trimmed_part)
|
result = re.findall(r"^c\/o(.*)$", trimmed_part)
|
||||||
if len(result) == 1:
|
if len(result) == 1:
|
||||||
co_company = result[0]
|
co_company = result[0].strip()
|
||||||
co_company_index = index
|
co_company_index = index
|
||||||
if co_company_index is not None:
|
if co_company_index is not None:
|
||||||
del parts[co_company_index]
|
del parts[co_company_index]
|
||||||
street = "".join(parts).strip()
|
street = "".join(parts).strip()
|
||||||
data["location"].street = street
|
data["location"].street = street
|
||||||
|
|
||||||
if co_company is not None:
|
if co_company is not None and co_company != "":
|
||||||
relation = CompanyToCompanyRelationship(
|
relation = CompanyToCompanyRelationship(
|
||||||
RelationshipRoleEnum.LOKATION_BEI, # type: ignore
|
RelationshipRoleEnum.CARE_OF, # type: ignore
|
||||||
Location(
|
Location(
|
||||||
data["location"].city,
|
data["location"].city,
|
||||||
street,
|
street,
|
||||||
|
@ -723,7 +723,7 @@ def test_map_last_update() -> None:
|
|||||||
"location": Location("", "Abc ffda", None, None),
|
"location": Location("", "Abc ffda", None, None),
|
||||||
"relationships": [
|
"relationships": [
|
||||||
CompanyToCompanyRelationship(
|
CompanyToCompanyRelationship(
|
||||||
RelationshipRoleEnum.LOKATION_BEI, # type: ignore
|
RelationshipRoleEnum.CARE_OF, # type: ignore
|
||||||
Location("", "Abc ffda", None, None),
|
Location("", "Abc ffda", None, None),
|
||||||
CompanyRelationshipEnum.COMPANY,
|
CompanyRelationshipEnum.COMPANY,
|
||||||
"Youco24 Business Center",
|
"Youco24 Business Center",
|
||||||
@ -734,7 +734,7 @@ def test_map_last_update() -> None:
|
|||||||
(
|
(
|
||||||
{
|
{
|
||||||
"location": Location(
|
"location": Location(
|
||||||
"", "c/o Youco24 Business Center, Abc Str.", "42", "58644"
|
"Iserlohn", "c/o Youco24 Business Center, Abc Str.", "42", "58644"
|
||||||
),
|
),
|
||||||
"relationships": [],
|
"relationships": [],
|
||||||
},
|
},
|
||||||
@ -742,8 +742,8 @@ def test_map_last_update() -> None:
|
|||||||
"location": Location("Iserlohn", "Abc Str.", "42", "58644"),
|
"location": Location("Iserlohn", "Abc Str.", "42", "58644"),
|
||||||
"relationships": [
|
"relationships": [
|
||||||
CompanyToCompanyRelationship(
|
CompanyToCompanyRelationship(
|
||||||
RelationshipRoleEnum.LOKATION_BEI, # type: ignore
|
RelationshipRoleEnum.CARE_OF, # type: ignore
|
||||||
Location("Iserlohn", "Abc ffda", "42", "58644"),
|
Location("Iserlohn", "Abc Str.", "42", "58644"),
|
||||||
CompanyRelationshipEnum.COMPANY,
|
CompanyRelationshipEnum.COMPANY,
|
||||||
"Youco24 Business Center",
|
"Youco24 Business Center",
|
||||||
)
|
)
|
||||||
@ -753,7 +753,7 @@ def test_map_last_update() -> None:
|
|||||||
(
|
(
|
||||||
{
|
{
|
||||||
"location": Location(
|
"location": Location(
|
||||||
"Iserlohn", "Abc Str. 42, c/o Youco24 Business Center", None, "58644"
|
"Iserlohn", "Abc Str., c/o Youco24 Business Center", "42", "58644"
|
||||||
),
|
),
|
||||||
"relationships": [],
|
"relationships": [],
|
||||||
},
|
},
|
||||||
@ -761,8 +761,8 @@ def test_map_last_update() -> None:
|
|||||||
"location": Location("Iserlohn", "Abc Str.", "42", "58644"),
|
"location": Location("Iserlohn", "Abc Str.", "42", "58644"),
|
||||||
"relationships": [
|
"relationships": [
|
||||||
CompanyToCompanyRelationship(
|
CompanyToCompanyRelationship(
|
||||||
RelationshipRoleEnum.LOKATION_BEI, # type: ignore
|
RelationshipRoleEnum.CARE_OF, # type: ignore
|
||||||
Location("Iserlohn", "Abc ffda", "42", "58644"),
|
Location("Iserlohn", "Abc Str.", "42", "58644"),
|
||||||
CompanyRelationshipEnum.COMPANY,
|
CompanyRelationshipEnum.COMPANY,
|
||||||
"Youco24 Business Center",
|
"Youco24 Business Center",
|
||||||
)
|
)
|
||||||
@ -771,9 +771,7 @@ def test_map_last_update() -> None:
|
|||||||
),
|
),
|
||||||
(
|
(
|
||||||
{
|
{
|
||||||
"location": Location(
|
"location": Location("Iserlohn", "Abc Str., c/o", "42", "58644"),
|
||||||
"Iserlohn", "Abc Str. 42, c/o", None, "58644"
|
|
||||||
),
|
|
||||||
"relationships": [],
|
"relationships": [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user