refactor: Pull Auditor extraction into Bundesanzeiger utils

This commit is contained in:
TrisNol
2023-08-18 16:21:52 +02:00
parent f64e0dd96e
commit 1e15656028
6 changed files with 214 additions and 227 deletions

View File

@ -0,0 +1 @@
"""Tests for data_extraction."""

View File

@ -0,0 +1,26 @@
from aki_prj23_transparenzregister.utils.data_extraction.bundesanzeiger import (
Bundesanzeiger,
)
def test_extract_auditor_company_no_hits() -> None:
input_data = """
Nothing to see here \O_O/
"""
ba = Bundesanzeiger()
result = ba.extract_auditor_company(input_data)
assert result is None
def test_extract_auditor_company() -> None:
company_name = "Korrupte Wirtschaftsprüfer GmbH & Co. KG"
input_data = f"""
<b>
{company_name}
<br>
Max Mustermann
</b>
"""
ba = Bundesanzeiger()
result = ba.extract_auditor_company(input_data)
assert result == company_name