Skip to content

Commit

Permalink
Adiciona teste que verifica sub-article sem atributo xml:lang
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelpezzuto committed Nov 9, 2022
1 parent 006b91d commit 477b7b4
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/sps/validation/test_article_and_subarticles.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,30 @@ def test_article_and_subarticles_with_two_valid_languages_and_one_invalid(self):
[e.line for e in errors]
)

def test_article_and_subarticles_with_one_valid_language_one_empty_and_one_invalid(self):
xml_str = """
<article article-type="research-article" dtd-version="1.1" specific-use="sps-1.9" xml:lang="en" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">
<sub-article article-type="translation" id="s1">
</sub-article>
<sub-article article-type="translation" id="s2" xml:lang="">
</sub-article>
</article>
"""
xml_tree = get_xml_tree(xml_str)
result, errors = validate_language(xml_tree)

self.assertFalse(result)

self.assertListEqual(
['XML translation has no language.', 'XML translation has an invalid language: '],
[e.message for e in errors]
)

self.assertListEqual(
[3, 5],
[e.line for e in errors]
)


def test_article_and_subarticles_with_two_invalid_languages(self):
xml_str = """
Expand Down

0 comments on commit 477b7b4

Please sign in to comment.