From 1b160d5a3c191f87bca2afb35599763fa2b43479 Mon Sep 17 00:00:00 2001 From: Christian Stefanescu Date: Mon, 18 Nov 2019 19:24:03 +0100 Subject: [PATCH] Add test for #64 --- tests/res/aws.xml | 486 ++++++++++++++++++++++++++++++++++++++++++++++ tests/tests.py | 10 + 2 files changed, 496 insertions(+) create mode 100644 tests/res/aws.xml diff --git a/tests/res/aws.xml b/tests/res/aws.xml new file mode 100644 index 0000000..5fc3c16 --- /dev/null +++ b/tests/res/aws.xml @@ -0,0 +1,486 @@ + + + + +d8106012-6e1e-4f1e-987b-7cd7ea9f5d98 + + + + + + +url +www.example.com + + +responsegroup +RelatedLinks,Categories,Rank,ContactInfo,RankByCountry,UsageStats,Speed,Language,OwnedDomains,LinksInCount,SiteData,AdultContent + + + + +example.com + + + + + + + + + +example.com + +example.com/ +14-Aug-1995 + + +461 +96 + +no + +en + +20864 + + + +example.com + + +www.w3.org/ +http://www.w3.org/ +World Wide Web Consortium + + +zen-cart.jp/ +http://zen-cart.jp/ +Zen Cart 日本語公式サイト + + +www.zen-cart.com/ +http://www.zen-cart.com/ +Zen Cart + + +www.z-f.fr/ +http://www.z-f.fr/ +Zend Framework France + + +www.wikispot.org/ +http://www.wikispot.org/ +Wiki Spot - Wikis for your community. Community for your wiki. + + +www.wikidot.com/ +http://www.wikidot.com/ +Wikidot.com + + +www.wikia.com/ +http://www.wikia.com/ +Wikia + + +www.webrankinfo.com/ +http://www.webrankinfo.com/ +Webrankinfo + + +www.webmasterworld.com/ +http://www.webmasterworld.com/ +Webmaster World + + +www.w3schools.com/ +http://www.w3schools.com/ +W3Schools Web Tutorials + + + + +example.com +16594 + + +5552 + +0.6% +0.7% + + + +9922 + +0.8% +0.9% + + + +5099 + +16.0% +17.0% + + + +9096 + +1.1% +1.2% + + + +5127 + +1.8% +2.1% + + + +4962 + +0.8% +1.0% + + + +9633 + +1.6% +1.8% + + + +8797 + +0.9% +0.5% + + + +33978 + +0.9% +1.0% + + + +10802 + +1.1% +1.2% + + + +6709 + +0.7% +0.7% + + + +2695 + +12.5% +7.0% + + + +4928 + +4.1% +1.6% + + + +14266 + +15.0% +16.8% + + + +9219 + +3.0% +3.3% + + + +12179 + +1.3% +1.5% + + + +13779 + +0.5% +0.6% + + + +2565 + +0.5% +0.5% + + + +5619 + +1.8% +1.5% + + + +8091 + +2.7% +3.4% + + + +12115 + +3.9% +2.9% + + + +16258 + +0.5% +0.6% + + + +12916 + +0.4% +0.5% + + + +13662 + +1.2% +1.4% + + + +16704 + +1.4% +1.7% + + + +17596 + +4.3% +4.6% + + + + + +17.8% +20.3% + + + +11599 + +3.1% +3.8% + + + + + + +3 + + +16594 +-1863 + + + +12960 +-2268 + + +60.2 ++10% + + + + +2.12 +-2.19% + + +31193 +350 + + +1.3 +-11.64% + + + + + +1 + + +12137 +-7169 + + + +9263 +-5629 + + +78 ++46% + + + + +2.6 ++49% + + +25377 +-11081 + + +1.3 ++2% + + + + + +7 + + +17260 ++6866 + + + +13150 ++5054 + + +55 +-38.08% + + + + +1.9 +-41.86% + + +37765 +15989 + + +1.2 +-6.061% + + + + + +1 + + +8708 +-3964 + + + +6609 +-4052 + + +110 ++60% + + + + +4 ++20% + + +20175 +-4357 + + +1 +-22.44% + + + + + + +example.com + +1 + + +88.48% + + +78.79% +1.1 + + + +gateway.example.com + +1 + + +10.45% + + +19.31% +2.3 + + + +OTHER + +1 + + +0.00% + + +1.89% +1.1 + + + + + + + +Success + + + diff --git a/tests/tests.py b/tests/tests.py index 6787dc4..c2a2041 100755 --- a/tests/tests.py +++ b/tests/tests.py @@ -366,6 +366,16 @@ def test_invalid_external_dtd(self): untangle.parse(self.bad_dtd_xml, feature_external_ges=True) +class FailsOnWindowsTestCase(unittest.TestCase): + def test_aws_xml_filepath(self): + untangle.parse("tests/res/aws.xml") + + def test_aws_xml_readfile(self): + with open("tests/res/aws.xml", "r") as input_file: + data = input_file.read() + self.assertEqual(untangle.parse(str(data)), "") + + if __name__ == "__main__": unittest.main()