Exemple #1
0
 def test_equal_match_attr(self):
     # Attribute truth — should meet the threshold
     root_one = etree.fromstring('<foo one="two" two="one">woot</foo>')
     root_two = etree.fromstring('<foo two="one" one="two">woohoot</foo>')
     self.assertTrue(equal_match(root_one, root_two))
Exemple #2
0
 def test_equal_match_not(self):
     # This should not match our threshold
     root_one = etree.fromstring('<foo>asdfghjkl</foo>')
     root_two = etree.fromstring('<foo>zxcvbnm</foo>')
     self.assertFalse(equal_match(root_one, root_two))
Exemple #3
0
 def test_equal_match(self):
     # Straight up true
     root_one = etree.fromstring('<foo>woot</foo>')
     root_two = etree.fromstring('<foo>woot</foo>')
     self.assertTrue(equal_match(root_one, root_two))
Exemple #4
0
 def test_equal_match_mostly(self):
     # Mostly true — this matches our threshold.
     root_one = etree.fromstring('<foo>woot</foo>')
     root_two = etree.fromstring('<foo>woohoot</foo>')
     self.assertTrue(equal_match(root_one, root_two))