Skip to content

Commit

Permalink
improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
exxamalte committed Oct 11, 2024
1 parent afba700 commit 8dd1cb3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
8 changes: 8 additions & 0 deletions tests/fixtures/xml_parser_simple_5.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" version="2.0">
<nochannel>
<item>
<title>Title 1</title>
</item>
</nochannel>
</rss>
10 changes: 9 additions & 1 deletion tests/test_xml_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_simple_2():


def test_simple_3():
"""Test parsing various actual XML files."""
"""Test parsing XML file with invalid tags."""
xml_parser = XmlParser()
xml = load_fixture("xml_parser_simple_3.xml")
feed = xml_parser.parse(xml)
Expand All @@ -50,6 +50,14 @@ def test_simple_4():
assert feed.entries[0].title == "1"


def test_simple_5():
"""Test parsing XML file with invalid tags."""
xml_parser = XmlParser()
xml = load_fixture("xml_parser_simple_5.xml")
feed = xml_parser.parse(xml)
assert feed is None


def test_complex_1():
"""Test parsing various actual XML files."""
xml_parser = XmlParser()
Expand Down

0 comments on commit 8dd1cb3

Please sign in to comment.