Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/tests/api/test_parser.py
Show All 26 Lines | <entry xmlns="http://www.w3.org/2005/Atom" | ||||
<codemeta:programmingLanguage>ocaml</codemeta:programmingLanguage> | <codemeta:programmingLanguage>ocaml</codemeta:programmingLanguage> | ||||
<codemeta:issueTracker>http://issuetracker.com</codemeta:issueTracker> | <codemeta:issueTracker>http://issuetracker.com</codemeta:issueTracker> | ||||
</entry>""" | </entry>""" | ||||
) | ) | ||||
actual_result = SWHXMLParser().parse(xml_no_duplicate) | actual_result = SWHXMLParser().parse(xml_no_duplicate) | ||||
expected_dict = OrderedDict( | expected_dict = OrderedDict( | ||||
[ | [ | ||||
("@xmlns", "http://www.w3.org/2005/Atom"), | |||||
("@xmlns:codemeta", "https://doi.org/10.5063/SCHEMA/CODEMETA-2.0"), | |||||
("title", "Awesome Compiler"), | ("title", "Awesome Compiler"), | ||||
( | ( | ||||
"codemeta:license", | "codemeta:license", | ||||
OrderedDict( | OrderedDict( | ||||
[ | [ | ||||
("codemeta:name", "GPL3.0"), | ("codemeta:name", "GPL3.0"), | ||||
("codemeta:url", "https://opensource.org/licenses/GPL-3.0"), | ("codemeta:url", "https://opensource.org/licenses/GPL-3.0"), | ||||
] | ] | ||||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | <entry xmlns="http://www.w3.org/2005/Atom" | ||||
<codemeta:programmingLanguage>python3</codemeta:programmingLanguage> | <codemeta:programmingLanguage>python3</codemeta:programmingLanguage> | ||||
</entry>""" | </entry>""" | ||||
) | ) | ||||
actual_result = SWHXMLParser().parse(xml_with_duplicates) | actual_result = SWHXMLParser().parse(xml_with_duplicates) | ||||
expected_dict = OrderedDict( | expected_dict = OrderedDict( | ||||
[ | [ | ||||
("@xmlns", "http://www.w3.org/2005/Atom"), | |||||
("@xmlns:codemeta", "https://doi.org/10.5063/SCHEMA/CODEMETA-2.0"), | |||||
("title", "Another Compiler"), | ("title", "Another Compiler"), | ||||
("codemeta:runtimePlatform", ["GNU/Linux", "Un*x"]), | ("codemeta:runtimePlatform", ["GNU/Linux", "Un*x"]), | ||||
( | ( | ||||
"codemeta:license", | "codemeta:license", | ||||
[ | [ | ||||
OrderedDict( | OrderedDict( | ||||
[ | [ | ||||
("codemeta:name", "GPL3.0"), | ("codemeta:name", "GPL3.0"), | ||||
Show All 29 Lines |