-
Notifications
You must be signed in to change notification settings - Fork 1
Description
The basic problem is that XML 1.0 needs an adapted text strategy because hypothesis.strategies.text() produces non-XML parsable strings.
lodkit.testing_tools.strategies is currently implemented using a Singleton approach defining a singleton using hypothesis.strategies.text() as a literal strategy and another singleton using an XML parsable text strategy for literals.
The singleton approach is kind of awkward because it introduces a class of properties for configuring a single parameter (xml_parsable: bool) which only affects literal strategies, namely triple_literals_plain, triple_literals_lang_tagged, triple_literals_xsd_typed.
Another option would be to have all lodkit strategies defined globally and move the xml_parsable: bool to the affected strategies, i.e. literal strategies and any strategy using a literal strategy...
Strategies requiring an xml_parsable_literals: bool flag would be:
-
literal strategies
triple_literals_plaintriple_literals_lang_typedtriple_literals_xsd_typedtriple_literals
-
triple strategies
triple_objectstriples
This is related to #10. Obviously, if testing support for XML serialization and parsing was dropped, this wouldn't be an issue.