-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from dsp_tools.xmllib.models.dsp_base_resources import AnnotationResource | ||
from dsp_tools.xmllib.models.resource import Resource | ||
from dsp_tools.xmllib.models.root import XMLRoot | ||
from dsp_tools.xmllib.value_checkers import is_bool_like | ||
from dsp_tools.xmllib.value_converters import convert_to_bool_string | ||
|
||
|
||
def test_xmllib() -> None: | ||
""" | ||
This does NOT test the xmllib. | ||
This only tests if all dependencies used in the xmllib are shipped in the distribution. | ||
For this purpose, it is enough to import all modules of the xmllib. | ||
Indirect imports are okay, too, i.e. modules that are imported by modules that are imported here. | ||
""" | ||
root = XMLRoot("0000", "my_onto") | ||
my_res = Resource.new("my_res", "restype", "label") | ||
if is_bool_like("0"): | ||
my_res.add_bool(convert_to_bool_string("0"), "my_prop") | ||
my_res.add_file("my_file") | ||
annotation = AnnotationResource.new("res_id", "label", "annotation_of", ["comment1", "comment2"]) | ||
root.add_resource(annotation) # type: ignore[arg-type] | ||
root.add_resource(my_res) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.