Skip to content

Add functions for XML-based input-output tests#116

Draft
flaktack wants to merge 7 commits into
MMTIS:binary_relation_serializerfrom
flaktack:xml-test-harness
Draft

Add functions for XML-based input-output tests#116
flaktack wants to merge 7 commits into
MMTIS:binary_relation_serializerfrom
flaktack:xml-test-harness

Conversation

@flaktack

Copy link
Copy Markdown

(Builds on and includes commits from #115)

This adds a test harness (dc63dae) to allow writing unit tests using simple NeTEx snippets. An example round trip test is included.

flaktack added 5 commits June 28, 2026 00:53
+ fix typings to parse
+ return None when retreiving unknown entities with version
This allows writing tests that test the XML input-output of
transformations.
Comment thread tests/transformers/test_harness_smoke.py Outdated
Comment thread tests/base.py
"""
load_netex(self.storage, frames_xml)

def read_objects(self, clazz: type[T]) -> list[T]:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand this is a test case. I am torn on creating multiple transactions here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple transactions in the sense that each method call creates a new transaction? I can modify the method to reuse a transaction passed in as a parameter.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also don't like passing transactions around. I foremost want to know why you don't like the context manager approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants