Skip to content
Snippets Groups Projects
Commit 25d75f1c authored by vlorentz's avatar vlorentz
Browse files

Validate codemeta:name

This only checks the name is a string.
parent d8cf768a
No related branches found
No related tags found
No related merge requests found
......@@ -286,6 +286,24 @@ def test_api_checks_check_metadata_ko(
_parameters3 = [
(textwrap.dedent(metadata_ko), expected_summary)
for (metadata_ko, expected_summary) in [
(
f"""\
<entry {XMLNS}>
<url>some url</url>
<codemeta:name>
<codemeta:name>bar</codemeta:name>
</codemeta:name>
<author>no one</author>
{PROVENANCE_XML}
</entry>
""",
[
{
"summary": ".*Reason: a simple content element can't have child elements.*",
"fields": ["codemeta:name"],
},
],
),
(
f"""\
<entry {XMLNS}>
......
......@@ -16,4 +16,6 @@
<xsd:simpleType name="DateOrDateTime">
<xsd:union memberTypes="xsd:date xsd:dateTime"/>
</xsd:simpleType>
<xsd:element name="name" type="xsd:string" />
</xsd:schema>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment