Skip to content
Snippets Groups Projects
Commit ab4a98f8 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files
parent 6cf10a47
No related branches found
No related tags found
2 merge requests!91Release 0.3,!72TST: add failing test for https://gitlab.com/caosdb/caosdb-crawler/-/issues/47
Pipeline #30998 passed
...@@ -110,3 +110,45 @@ def test_issue_39(): ...@@ -110,3 +110,45 @@ def test_issue_39():
# this would result in a merge conflict before # this would result in a merge conflict before
ins, ups = crawler.split_into_inserts_and_updates(flat_list) ins, ups = crawler.split_into_inserts_and_updates(flat_list)
@mark.xfail(reason="FIX: https://gitlab.com/caosdb/caosdb-crawler/-/issues/47")
def test_list_datatypes():
crawler_definition = {
"DictTest": {
"type": "DictElement",
"match": "(.*)",
"records": {
"Dataset": {}
},
"subtree": {
"int_element": {
"type": "IntegerElement",
"match_name": ".*",
"match_value": "(?P<int_value>.*)",
"records": {
"Dataset": {
"Subject": "+$int_value"
}
}
}
}
}
}
crawler = Crawler(debug=True)
converter_registry = crawler.load_converters(crawler_definition)
test_dict = {
"v1": 1233,
"v2": 1234
}
records = crawler.start_crawling(
DictElement("TestDict", test_dict), crawler_definition, converter_registry)
assert len(records) == 1
assert records[0].parents[0].name == "Dataset"
assert records[0].get_property("Subject") is not None
assert isinstance(records[0].get_property("Subject").value, list)
assert records[0].get_property("Subject").datatype is not None
assert records[0].get_property("Subject").datatype.startswith("LIST")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment