Skip to content

Commit

Permalink
add unit test for equals sign in file name when parsing ebxml
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinWheelerMT committed Dec 11, 2024
1 parent b084d8a commit 6939b5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions mhs/common/mhs_common/messages/ebxml_envelope.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ def parse_external_attachments(xml_tree: Element) -> Dict[str, str]:
variables = descriptionParams = re.findall("(?:\".*?\"|\S)+", description.strip())

filename = None
print(variables)
description_variables = dict(pair.split("=") for pair in variables)
if "Filename" in description_variables:
filename = description_variables["Filename"].replace('\\', '')
Expand Down
6 changes: 3 additions & 3 deletions mhs/common/mhs_common/messages/tests/test_ebxml_envelope.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ def test_filename_contains_equals_sign(self):
)
xml_tree = ElementTree.fromstring(message)

result = ebxml_envelope.EbxmlEnvelope.parse_external_attachments(xml_tree)
values_dict = {}
self.assertEqual(result, values_dict)
external_attachments = ebxml_envelope.EbxmlEnvelope.parse_external_attachments(xml_tree)
print(external_attachments.keys())
self.assertEqual(external_attachments, {})

0 comments on commit 6939b5d

Please sign in to comment.