Skip to content
Snippets Groups Projects
Commit aec2772b authored by vlorentz's avatar vlorentz Committed by vlorentz
Browse files

test_checks: Fix tag names

A future commit will reject these invalid tags
parent 8116ef9d
No related branches found
No related tags found
No related merge requests found
......@@ -45,8 +45,8 @@ _parameters1 = [
"atom-only-with-name",
f"""\
<entry {XMLNS}>
<url>something</url>
<external_identifier>something-else</external_identifier>
<uri>something</uri>
<id>something-else</id>
<name>foo</name>
<author>someone</author>
{PROVENANCE_XML}
......@@ -57,19 +57,19 @@ _parameters1 = [
"atom-only-with-title",
f"""\
<entry {XMLNS}>
<url>something</url>
<external_identifier>something-else</external_identifier>
<uri>something</uri>
<id>something-else</id>
<title>bar</title>
<author>someone</author>
</entry>
""",
),
(
"atom-only-and-external_identifier",
"atom-only-and-id",
f"""\
<entry {XMLNS}>
<url>something</url>
<external_identifier>something-else</external_identifier>
<uri>something</uri>
<id>something-else</id>
<name>foo</name>
<author>no one</author>
{PROVENANCE_XML}
......@@ -80,7 +80,7 @@ _parameters1 = [
"atom-and-codemeta-minimal",
f"""\
<entry {XMLNS}>
<url>some url</url>
<uri>some url</uri>
<codemeta:name>bar</codemeta:name>
<codemeta:author>
<codemeta:name>no one</codemeta:name>
......@@ -93,7 +93,7 @@ _parameters1 = [
"unknown-codemeta-inner-element-after",
f"""\
<entry {XMLNS}>
<url>some url</url>
<uri>some url</uri>
<codemeta:name>bar</codemeta:name>
<codemeta:author>
<codemeta:name>someone</codemeta:name>
......@@ -107,7 +107,7 @@ _parameters1 = [
"unknown-schema-inner-element-after",
f"""\
<entry {XMLNS}>
<url>some url</url>
<uri>some url</uri>
<codemeta:name>bar</codemeta:name>
<codemeta:author>
<codemeta:name>someone</codemeta:name>
......@@ -121,7 +121,7 @@ _parameters1 = [
"unknown-schema-inner-element-before",
f"""\
<entry {XMLNS}>
<url>some url</url>
<uri>some url</uri>
<codemeta:name>bar</codemeta:name>
<codemeta:author>
<schema:unknown-tag>should allow anything here</schema:unknown-tag>
......@@ -135,7 +135,7 @@ _parameters1 = [
"unknown-schema-inner-element-before-and-after",
f"""\
<entry {XMLNS}>
<url>some url</url>
<uri>some url</uri>
<codemeta:name>bar</codemeta:name>
<codemeta:author>
<schema:unknown-tag>should allow anything here</schema:unknown-tag>
......@@ -150,7 +150,7 @@ _parameters1 = [
"identifier-is-halid",
f"""\
<entry {XMLNS}>
<url>some url</url>
<uri>some url</uri>
<codemeta:name>bar</codemeta:name>
<codemeta:author>
<codemeta:name>The Author</codemeta:name>
......@@ -164,7 +164,7 @@ _parameters1 = [
"identifier-is-propertyvalue",
f"""\
<entry {XMLNS}>
<url>some url</url>
<uri>some url</uri>
<codemeta:name>bar</codemeta:name>
<codemeta:author>
<codemeta:name>The Author</codemeta:name>
......@@ -182,8 +182,8 @@ _parameters1 = [
"codemeta-dates",
f"""\
<entry {XMLNS}>
<url>some url</url>
<external_identifier>some id</external_identifier>
<uri>some url</uri>
<id>some id</id>
<name>nar</name>
<author>no one</author>
<codemeta:datePublished>2020-12-21</codemeta:datePublished>
......@@ -199,8 +199,8 @@ _parameters1 = [
# Allowed by ISO8601, therefore by schema:Date, but not by xsd:date
f"""\
<entry {XMLNS}>
<url>some url</url>
<external_identifier>some id</external_identifier>
<uri>some url</uri>
<id>some id</id>
<name>nar</name>
<author>no one</author>
<codemeta:datePublished>2020-12</codemeta:datePublished>
......@@ -215,8 +215,8 @@ _parameters1 = [
# Allowed by ISO8601, therefore by schema:Date, but not by xsd:date
f"""\
<entry {XMLNS}>
<url>some url</url>
<external_identifier>some id</external_identifier>
<uri>some url</uri>
<id>some id</id>
<name>nar</name>
<author>no one</author>
<codemeta:datePublished>2020</codemeta:datePublished>
......@@ -232,8 +232,8 @@ _parameters1 = [
# for backward compatibility with old swh-deposit versions
f"""\
<entry {XMLNS}>
<url>some url</url>
<external_identifier>some id</external_identifier>
<uri>some url</uri>
<id>some id</id>
<name>nar</name>
<author>no one</author>
<codemeta:datePublished>2020-12-21T12:00:00</codemeta:datePublished>
......@@ -247,7 +247,7 @@ _parameters1 = [
"author-two-names",
f"""\
<entry {XMLNS}>
<url>some url</url>
<uri>some url</uri>
<codemeta:name>bar</codemeta:name>
<codemeta:author>
<codemeta:name>someone</codemeta:name>
......@@ -263,7 +263,7 @@ _parameters1 = [
"element-in--affiliation",
f"""\
<entry {XMLNS}>
<url>some url</url>
<uri>some url</uri>
<codemeta:name>bar</codemeta:name>
<codemeta:author>
<codemeta:name>someone</codemeta:name>
......@@ -281,7 +281,7 @@ _parameters1 = [
"chardata-in-affiliation",
f"""\
<entry {XMLNS}>
<url>some url</url>
<uri>some url</uri>
<codemeta:name>bar</codemeta:name>
<codemeta:author>
<codemeta:name>someone</codemeta:name>
......@@ -295,8 +295,8 @@ _parameters1 = [
"swh:add_to_origin",
f"""\
<entry {XMLNS}>
<url>something</url>
<external_identifier>something-else</external_identifier>
<uri>something</uri>
<id>something-else</id>
<title>bar</title>
<author>someone</author>
<swh:deposit>
......@@ -314,8 +314,8 @@ _parameters1 = [
"swh:reference-origin",
f"""\
<entry {XMLNS}>
<url>something</url>
<external_identifier>something-else</external_identifier>
<uri>something</uri>
<id>something-else</id>
<title>bar</title>
<author>someone</author>
<swh:deposit>
......@@ -333,8 +333,8 @@ _parameters1 = [
"swh:reference-object",
f"""\
<entry {XMLNS}>
<url>something</url>
<external_identifier>something-else</external_identifier>
<uri>something</uri>
<id>something-else</id>
<title>bar</title>
<author>someone</author>
<swh:deposit>
......@@ -353,7 +353,7 @@ _parameters1 = [
"codemeta-full",
f"""\
<entry {XMLNS}>
<url>something</url>
<uri>something</uri>
<name>foo</name>
<author>someone</author>
<codemeta:author>
......@@ -433,7 +433,7 @@ _parameters2 = [
f"""\
<entry {XMLNS}>
<url>something</url>
<external_identifier>something-else</external_identifier>
<id>something-else</id>
<author>someone</author>
{PROVENANCE_XML}
</entry>
......@@ -448,7 +448,7 @@ _parameters2 = [
f"""\
<entry {XMLNS}>
<url>something</url>
<external_identifier>something-else</external_identifier>
<id>something-else</id>
<title>foobar</title>
{PROVENANCE_XML}
</entry>
......@@ -546,7 +546,7 @@ _parameters2 = [
f"""\
<entry {XMLNS}>
<url>something</url>
<external_identifier>something-else</external_identifier>
<id>something-else</id>
<codemeta:title>bar</codemeta:title>
<author>someone</author>
{PROVENANCE_XML}
......@@ -565,7 +565,7 @@ _parameters2 = [
xmlns:codemeta="https://doi.org/10.5063/SCHEMA/CODEMETA-2.0"
xmlns:schema="http://schema.org/">
<atom:url>something</atom:url>
<atom:external_identifier>something-else</atom:external_identifier>
<atom:id>something-else</atom:id>
<atom:title>foobar</atom:title>
<author>foo</author>
{PROVENANCE_XML}
......@@ -581,7 +581,7 @@ _parameters2 = [
f"""\
<entry {XMLNS}>
<url>something</url>
<external_identifier>something-else</external_identifier>
<id>something-else</id>
<title>bar</title>
<authorblahblah>someone</authorblahblah>
{PROVENANCE_XML}
......@@ -612,7 +612,7 @@ _parameters3 = [
"child-element-in-name",
f"""\
<entry {XMLNS}>
<url>some url</url>
<uri>some url</uri>
<codemeta:name>
<codemeta:name>bar</codemeta:name>
</codemeta:name>
......@@ -631,7 +631,7 @@ _parameters3 = [
"affiliation-with-no-name",
f"""\
<entry {XMLNS}>
<url>some url</url>
<uri>some url</uri>
<codemeta:name>bar</codemeta:name>
<codemeta:author>
<codemeta:name>someone</codemeta:name>
......@@ -653,7 +653,7 @@ _parameters3 = [
"empty-affiliation",
f"""\
<entry {XMLNS}>
<url>some url</url>
<uri>some url</uri>
<codemeta:name>bar</codemeta:name>
<codemeta:author>
<codemeta:name>someone</codemeta:name>
......@@ -674,7 +674,7 @@ _parameters3 = [
"chardata-in-author",
f"""\
<entry {XMLNS}>
<url>some url</url>
<uri>some url</uri>
<codemeta:name>bar</codemeta:name>
<codemeta:author>no one</codemeta:author>
{PROVENANCE_XML}
......@@ -691,7 +691,7 @@ _parameters3 = [
"author-with-no-name",
f"""\
<entry {XMLNS}>
<url>some url</url>
<uri>some url</uri>
<codemeta:name>bar</codemeta:name>
<codemeta:author>
<schema:unknown-tag>should allow anything here</schema:unknown-tag>
......@@ -710,7 +710,7 @@ _parameters3 = [
"contributor-with-no-name",
f"""\
<entry {XMLNS}>
<url>some url</url>
<uri>some url</uri>
<codemeta:name>bar</codemeta:name>
<codemeta:author>
<codemeta:name>should allow anything here</codemeta:name>
......@@ -732,7 +732,7 @@ _parameters3 = [
"maintainer-with-no-name",
f"""\
<entry {XMLNS}>
<url>some url</url>
<uri>some url</uri>
<codemeta:name>bar</codemeta:name>
<codemeta:author>
<codemeta:name>should allow anything here</codemeta:name>
......@@ -754,7 +754,7 @@ _parameters3 = [
"id-is-not-url",
f"""\
<entry {XMLNS}>
<url>some url</url>
<uri>some url</uri>
<codemeta:name>bar</codemeta:name>
<codemeta:author>
<codemeta:name>The Author</codemeta:name>
......@@ -774,7 +774,7 @@ _parameters3 = [
"identifier-is-invalid-url",
f"""\
<entry {XMLNS}>
<url>some url</url>
<uri>some url</uri>
<codemeta:name>bar</codemeta:name>
<codemeta:author>
<codemeta:name>The Author</codemeta:name>
......@@ -796,7 +796,7 @@ _parameters3 = [
"identifier-is-not-url",
f"""\
<entry {XMLNS}>
<url>some url</url>
<uri>some url</uri>
<codemeta:name>bar</codemeta:name>
<codemeta:author>
<codemeta:name>The Author</codemeta:name>
......@@ -816,7 +816,7 @@ _parameters3 = [
"identifier-is-not-url2",
f"""\
<entry {XMLNS}>
<url>some url</url>
<uri>some url</uri>
<codemeta:name>bar</codemeta:name>
<codemeta:author>
<codemeta:name>The Author</codemeta:name>
......@@ -836,8 +836,8 @@ _parameters3 = [
"invalid-dates",
f"""\
<entry {XMLNS}>
<url>something</url>
<external_identifier>something-else</external_identifier>
<uri>something</uri>
<id>something-else</id>
<title>bar</title>
<author>someone</author>
<codemeta:datePublished>2020-aa-21</codemeta:datePublished>
......@@ -860,8 +860,8 @@ _parameters3 = [
"invalid-dateModified",
f"""\
<entry {XMLNS}>
<url>some url</url>
<external_identifier>someid</external_identifier>
<uri>some url</uri>
<id>someid</id>
<title>bar</title>
<author>no one</author>
<codemeta:dateModified>2020-12-aa</codemeta:dateModified>
......@@ -879,8 +879,8 @@ _parameters3 = [
"invalid-embargoDate",
f"""\
<entry {XMLNS}>
<url>some url</url>
<external_identifier>someid</external_identifier>
<uri>some url</uri>
<id>someid</id>
<title>bar</title>
<author>no one</author>
<codemeta:embargoDate>2022-02-28T12:00:00</codemeta:embargoDate>
......@@ -898,7 +898,7 @@ _parameters3 = [
"error-and-missing-provenance",
f"""\
<entry {XMLNS}>
<url>some url</url>
<uri>some url</uri>
<codemeta:name>bar</codemeta:name>
<codemeta:author>no one</codemeta:author>
</entry>
......@@ -918,8 +918,8 @@ _parameters3 = [
"unknown-tag-in-swh-namespace",
f"""\
<entry {XMLNS}>
<url>something</url>
<external_identifier>something-else</external_identifier>
<uri>something</uri>
<id>something-else</id>
<title>bar</title>
<author>someone</author>
<swh:deposit>
......@@ -946,8 +946,8 @@ _parameters3 = [
"multiple-swh:add_to_origin",
f"""\
<entry {XMLNS}>
<url>something</url>
<external_identifier>something-else</external_identifier>
<uri>something</uri>
<id>something-else</id>
<title>bar</title>
<author>someone</author>
<swh:deposit>
......@@ -976,8 +976,8 @@ _parameters3 = [
"swh:add_to_origin-and-swh:create_origin",
f"""\
<entry {XMLNS}>
<url>something</url>
<external_identifier>something-else</external_identifier>
<uri>something</uri>
<id>something-else</id>
<title>bar</title>
<author>someone</author>
<swh:deposit>
......@@ -1008,8 +1008,8 @@ _parameters3 = [
"swh:reference-and-swh:create_origin",
f"""\
<entry {XMLNS}>
<url>something</url>
<external_identifier>something-else</external_identifier>
<uri>something</uri>
<id>something-else</id>
<title>bar</title>
<author>someone</author>
<swh:deposit>
......@@ -1040,8 +1040,8 @@ _parameters3 = [
"swh:add_to_origin-and-swh:reference",
f"""\
<entry {XMLNS}>
<url>something</url>
<external_identifier>something-else</external_identifier>
<uri>something</uri>
<id>something-else</id>
<title>bar</title>
<author>someone</author>
<swh:deposit>
......@@ -1072,8 +1072,8 @@ _parameters3 = [
"swh:reference-two-children",
f"""\
<entry {XMLNS}>
<url>something</url>
<external_identifier>something-else</external_identifier>
<uri>something</uri>
<id>something-else</id>
<title>bar</title>
<author>someone</author>
<swh:deposit>
......@@ -1098,8 +1098,8 @@ _parameters3 = [
"swh:reference-two-origins",
f"""\
<entry {XMLNS}>
<url>something</url>
<external_identifier>something-else</external_identifier>
<uri>something</uri>
<id>something-else</id>
<title>bar</title>
<author>someone</author>
<swh:deposit>
......@@ -1124,8 +1124,8 @@ _parameters3 = [
"swh:reference-two-objects",
f"""\
<entry {XMLNS}>
<url>something</url>
<external_identifier>something-else</external_identifier>
<uri>something</uri>
<id>something-else</id>
<title>bar</title>
<author>someone</author>
<swh:deposit>
......
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