mirror of
https://github.com/fhswf/aki_prj23_transparenzregister.git
synced 2025-06-22 08:33:54 +02:00
refactor: Pull Auditor extraction into Bundesanzeiger utils
This commit is contained in:
1
tests/utils/data_extraction/__init__.py
Normal file
1
tests/utils/data_extraction/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
"""Tests for data_extraction."""
|
26
tests/utils/data_extraction/bundesanzeiger_test.py
Normal file
26
tests/utils/data_extraction/bundesanzeiger_test.py
Normal 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
|
Reference in New Issue
Block a user