Example #1
0
 def rmttest_neg02(self):
     "xmlcmp: types of subnode differ"
     r, s = xmlcmp_strings('<hu>Mein Text</hu>', '<hu><uj></uj></hu>')
     assert not r
     assert re.match(r"Child node \[<DOM Text node \"u?'Mein Text'\">\] "
                     r"not found at \[\] - last error was "
                     r"\[Node types differ \[3\] != \[1\] at \[/hu\]\]", s)
Example #2
0
 def test_neg05(self):
     "xmlcmp: Text node in sub node differs"
     mem_log_store = MemLogStore()
     r, s = xmlcmp_strings('<hu><hi>Was</hi></hu>', '<hu><hi>Ist</hi></hu>',
                           mem_log_store)
     assert(r == False)
     assert(re.match("""Child node \[<DOM Element: hi at 0x[0-9a-f]*>\] not found at \[\] - last error was \[Child node \[<DOM Text node "u'Was'">\] not found at \[/hu\] - last error was \[Text Node data differs \[Was\] != \[Ist\] at \[/hu/hi\]\]\]""", s))
Example #3
0
 def test_neg04(self):
     "xmlcmp: number of child nodes differ"
     mem_log_store = MemLogStore()
     r, s = xmlcmp_strings('<hu><h1></h1></hu>',
                           '<hu><h2></h2><h1></h1></hu>', mem_log_store)
     assert(r == False)
     assert(s == "Number of child nodes differs [1] != [2] at []")
Example #4
0
 def test_pos02(self):
     "xmlcmp: same tags with different arrtibutes"
     mem_log_store = MemLogStore()
     r, s = xmlcmp_strings(
         '<hu><t a="1"/><t b="2"/></hu>',
         '<hu><t b="2"/><t a="1"/></hu>', mem_log_store)
     assert(r == True)
Example #5
0
 def test_neg05(self):
     "xmlcmp: Text node in sub node differs"
     r, s = xmlcmp_strings('<hu><hi>Was</hi></hu>', '<hu><hi>Ist</hi></hu>')
     assert (r == False)
     assert (re.match(
         """Child node \[<DOM Element: hi at 0x[0-9a-f]*>\] not found at \[\] - last error was \[Child node \[<DOM Text node "u'Was'">\] not found at \[/hu\] - last error was \[Text Node data differs \[Was\] != \[Ist\] at \[/hu/hi\]\]\]""",
         s))
Example #6
0
 def test_neg02(self):
     "xmlcmp: types of subnode differ"
     mem_log_store = MemLogStore()
     r, s = xmlcmp_strings('<hu>Mein Text</hu>', '<hu><uj></uj></hu>',
                           mem_log_store)
     assert(r == False)
     assert(s == """Child node [<DOM Text node "u'Mein Text'">] not found at [] - last error was [Node types differ [3] != [1] at [/hu]]""")
Example #7
0
 def rmttest_neg03(self):
     "xmlcmp: text data differs"
     r, s = xmlcmp_strings('<hu>Was</hu>', '<hu>Ist</hu>')
     assert not r
     assert re.match(r"Child node \[<DOM Text node \"u?'Was'\">\] "
                     r"not found at \[\] - last error was \[Text Node "
                     r"data differs \[Was\] != \[Ist\] at \[/hu\]\]", s)
Example #8
0
 def test_neg03(self):
     "xmlcmp: text data differs"
     r, s = xmlcmp_strings('<hu>Was</hu>', '<hu>Ist</hu>')
     assert (r == False)
     assert (
         s ==
         """Child node [<DOM Text node "u'Was'">] not found at [] - last error was [Text Node data differs [Was] != [Ist] at [/hu]]"""
     )
Example #9
0
 def test_neg02(self):
     "xmlcmp: types of subnode differ"
     r, s = xmlcmp_strings('<hu>Mein Text</hu>', '<hu><uj></uj></hu>')
     assert (r == False)
     assert (
         s ==
         """Child node [<DOM Text node "u'Mein Text'">] not found at [] - last error was [Node types differ [3] != [1] at [/hu]]"""
     )
Example #10
0
 def rmttest_neg05(self):
     "xmlcmp: Text node in sub node differs"
     r, s = xmlcmp_strings('<hu><hi>Was</hi></hu>', '<hu><hi>Ist</hi></hu>')
     assert not r
     assert re.match(r"Child node \[<DOM Element: hi at 0x[0-9a-f]*>\] "
                     r"not found at \[\] - last error was \[Child node "
                     r"\[<DOM Text node \"u?'Was'\">\] not found at \[/hu\]"
                     r" - last error was \[Text Node data differs \[Was\] "
                     r"!= \[Ist\] at \[/hu/hi\]\]\]", s)
Example #11
0
 def test_neg01(self):
     "xmlcmp: top level node names differ"
     mem_log_store = MemLogStore()
     r, s = xmlcmp_strings('<hu/>', '<hi/>', mem_log_store)
     assert(r == False)
     assert(s == "Tag names differ [hu] != [hi] at []")
Example #12
0
 def test_pos01(self):
     "xmlcmp: small xml document"
     r, s = xmlcmp_strings('<hu/>', '<hu/>')
     assert(r == True)
Example #13
0
 def rmttest_neg04(self):
     "xmlcmp: number of child nodes differ"
     r, s = xmlcmp_strings('<hu><h1></h1></hu>',
                           '<hu><h2></h2><h1></h1></hu>')
     assert not r
     assert "Number of child nodes differs [1] != [2] at []" == s
Example #14
0
 def test_neg01(self):
     "xmlcmp: top level node names differ"
     r, s = xmlcmp_strings('<hu/>', '<hi/>')
     assert (r == False)
     assert (s == "Tag names differ [hu] != [hi] at []")
Example #15
0
 def rmttest_neg01(self):
     "xmlcmp: top level node names differ"
     r, s = xmlcmp_strings('<hu/>', '<hi/>')
     assert not r
     assert "Tag names differ [hu] != [hi] at []" == s
Example #16
0
 def rmttest_pos02(self):
     "xmlcmp: same tags with different arrtibutes"
     r, s = xmlcmp_strings(
         '<hu><t a="1"/><t b="2"/></hu>',
         '<hu><t b="2"/><t a="1"/></hu>')
     assert r
Example #17
0
 def rmttest_pos01(self):
     "xmlcmp: small xml document"
     r, s = xmlcmp_strings('<hu/>', '<hu/>')
     assert r
Example #18
0
 def test_neg04(self):
     "xmlcmp: number of child nodes differ"
     r, s = xmlcmp_strings('<hu><h1></h1></hu>',
                           '<hu><h2></h2><h1></h1></hu>')
     assert (r == False)
     assert (s == "Number of child nodes differs [1] != [2] at []")
Example #19
0
 def test_neg03(self):
     "xmlcmp: text data differs"
     mem_log_store = MemLogStore()
     r, s = xmlcmp_strings('<hu>Was</hu>', '<hu>Ist</hu>', mem_log_store)
     assert(r == False)
     assert(s == """Child node [<DOM Text node "u'Was'">] not found at [] - last error was [Text Node data differs [Was] != [Ist] at [/hu]]""")
Example #20
0
 def test_neg01(self):
     "xmlcmp: top level node names differ"
     r, s = xmlcmp_strings('<hu/>', '<hi/>')
     assert(r == False)
     assert(s == "Tag names differ [hu] != [hi] at []")
Example #21
0
 def test_pos02(self):
     "xmlcmp: same tags with different arrtibutes"
     r, s = xmlcmp_strings(
         '<hu><t a="1"/><t b="2"/></hu>',
         '<hu><t b="2"/><t a="1"/></hu>')
     assert(r == True)
Example #22
0
 def test_neg04(self):
     "xmlcmp: number of child nodes differ"
     r, s = xmlcmp_strings('<hu><h1></h1></hu>',
                           '<hu><h2></h2><h1></h1></hu>')
     assert(r == False)
     assert(s == "Number of child nodes differs [1] != [2] at []")