Skip to content

Commit

Permalink
fix: format is not "AWF" but "UTILTS" (#10)
Browse files Browse the repository at this point in the history
* fix: format is not "AWF" but "UTILTS"

* black
  • Loading branch information
hf-kklein committed May 31, 2024
1 parent 080f40c commit a6e09ae
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Das Ergebnis sieht dann so aus:
"pruefidentifikator": "25001",
"beschreibung": "Berechnungsformel",
"kommunikation_von": "NB an MSB / LF",
"format": "AWF",
"format": "UTILTS",
"segments": [
{
"id": "UNH",
Expand Down
2 changes: 1 addition & 1 deletion src/fundamend/reader/ahbreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def _read_anwendungsfall(self, original_element: ET.Element) -> Anwendungsfall:
pruefidentifikator=original_element.attrib["Pruefidentifikator"],
beschreibung=original_element.attrib["Beschreibung"],
kommunikation_von=original_element.attrib["Kommunikation_von"],
format=original_element.tag.lstrip("M_"),
format=original_element[0].tag.lstrip("M_"),
segments=[s for s in segments_and_groups if isinstance(s, Segment)],
segment_groups=[s for s in segments_and_groups if isinstance(s, SegmentGroup)],
)
Expand Down
18 changes: 9 additions & 9 deletions unittests/example_ahb_utilts_11c.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
pruefidentifikator="25001",
beschreibung="Berechnungsformel",
kommunikation_von="NB an MSB / LF",
format="AWF",
format="UTILTS",
segments=[
Segment(
id="UNH",
Expand Down Expand Up @@ -6731,7 +6731,7 @@
pruefidentifikator="25002",
beschreibung="Ablehnung Berechnungsformel",
kommunikation_von="MSB an NB",
format="AWF",
format="UTILTS",
segments=[
Segment(
id="UNH",
Expand Down Expand Up @@ -13439,7 +13439,7 @@
pruefidentifikator="25003",
beschreibung="Zustimmung Berechnungsformel",
kommunikation_von="MSB an NB",
format="AWF",
format="UTILTS",
segments=[
Segment(
id="UNH",
Expand Down Expand Up @@ -20147,7 +20147,7 @@
pruefidentifikator="25009",
beschreibung="Übermittlung einer ausgerollten Leistungskurvendefinition",
kommunikation_von="NB an LF / MSB\r\nLF an NB, MSB",
format="AWF",
format="UTILTS",
segments=[
Segment(
id="UNH",
Expand Down Expand Up @@ -26855,7 +26855,7 @@
pruefidentifikator="25008",
beschreibung="Übermittlung einer ausgerollten Schaltzeitdefinition",
kommunikation_von="NB an LF / MSB\r\nLF an NB, MSB",
format="AWF",
format="UTILTS",
segments=[
Segment(
id="UNH",
Expand Down Expand Up @@ -33563,7 +33563,7 @@
pruefidentifikator="25005",
beschreibung="Übermittlung einer ausgerollten Zählzeitdefinition",
kommunikation_von="NB an LF / MSB\r\nLF an MSB",
format="AWF",
format="UTILTS",
segments=[
Segment(
id="UNH",
Expand Down Expand Up @@ -40271,7 +40271,7 @@
pruefidentifikator="25007",
beschreibung="Übermittlung Übersicht Leistungskurvendefinitionen",
kommunikation_von="NB an LF / MSB\r\nLF an NB, MSB",
format="AWF",
format="UTILTS",
segments=[
Segment(
id="UNH",
Expand Down Expand Up @@ -46979,7 +46979,7 @@
pruefidentifikator="25006",
beschreibung="Übermittlung Übersicht Schaltzeitdefinitionen",
kommunikation_von="NB an LF / MSB\r\nLF an NB, MSB",
format="AWF",
format="UTILTS",
segments=[
Segment(
id="UNH",
Expand Down Expand Up @@ -53687,7 +53687,7 @@
pruefidentifikator="25004",
beschreibung="Übermittlung Übersicht Zählzeitdefinitionen",
kommunikation_von="NB an LF / MSB\r\nLF an MSB",
format="AWF",
format="UTILTS",
segments=[
Segment(
id="UNH",
Expand Down
18 changes: 9 additions & 9 deletions unittests/example_ahb_utilts_11d.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
pruefidentifikator="25001",
beschreibung="Berechnungsformel",
kommunikation_von="NB an MSB / LF",
format="AWF",
format="UTILTS",
segments=[
Segment(
id="UNH",
Expand Down Expand Up @@ -6683,7 +6683,7 @@
pruefidentifikator="25002",
beschreibung="Ablehnung Berechnungsformel",
kommunikation_von="MSB an NB",
format="AWF",
format="UTILTS",
segments=[
Segment(
id="UNH",
Expand Down Expand Up @@ -13343,7 +13343,7 @@
pruefidentifikator="25003",
beschreibung="Zustimmung Berechnungsformel",
kommunikation_von="MSB an NB",
format="AWF",
format="UTILTS",
segments=[
Segment(
id="UNH",
Expand Down Expand Up @@ -20003,7 +20003,7 @@
pruefidentifikator="25009",
beschreibung="Übermittlung einer ausgerollten Leistungskurvendefinition",
kommunikation_von="NB an LF / MSB\r\nLF an NB, MSB",
format="AWF",
format="UTILTS",
segments=[
Segment(
id="UNH",
Expand Down Expand Up @@ -26663,7 +26663,7 @@
pruefidentifikator="25008",
beschreibung="Übermittlung einer ausgerollten Schaltzeitdefinition",
kommunikation_von="NB an LF / MSB\r\nLF an NB, MSB",
format="AWF",
format="UTILTS",
segments=[
Segment(
id="UNH",
Expand Down Expand Up @@ -33323,7 +33323,7 @@
pruefidentifikator="25005",
beschreibung="Übermittlung einer ausgerollten Zählzeitdefinition",
kommunikation_von="NB an LF / MSB\r\nLF an MSB",
format="AWF",
format="UTILTS",
segments=[
Segment(
id="UNH",
Expand Down Expand Up @@ -39983,7 +39983,7 @@
pruefidentifikator="25007",
beschreibung="Übermittlung Übersicht Leistungskurvendefinitionen",
kommunikation_von="NB an LF / MSB\r\nLF an NB, MSB",
format="AWF",
format="UTILTS",
segments=[
Segment(
id="UNH",
Expand Down Expand Up @@ -46643,7 +46643,7 @@
pruefidentifikator="25006",
beschreibung="Übermittlung Übersicht Schaltzeitdefinitionen",
kommunikation_von="NB an LF / MSB\r\nLF an NB, MSB",
format="AWF",
format="UTILTS",
segments=[
Segment(
id="UNH",
Expand Down Expand Up @@ -53303,7 +53303,7 @@
pruefidentifikator="25004",
beschreibung="Übermittlung Übersicht Zählzeitdefinitionen",
kommunikation_von="NB an LF / MSB\r\nLF an MSB",
format="AWF",
format="UTILTS",
segments=[
Segment(
id="UNH",
Expand Down
2 changes: 2 additions & 0 deletions unittests/test_ahbreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ def test_get_anwendungsfall(ahb_xml_file_path: Path, pruefidentifikator: str, ex
assert actual is not None
assert isinstance(actual, Anwendungsfall)
assert actual.pruefidentifikator == pruefidentifikator
if "UTILTS" in str(ahb_xml_file_path):
assert actual.format == "UTILTS"
else:
assert actual is None

Expand Down

0 comments on commit a6e09ae

Please sign in to comment.