コード例 #1
0
ファイル: test_xtdiff.py プロジェクト: willbarton/xtdiff
 def test_match_bottom_two(self):
     # This should still match the bottom two nodes
     root_one = etree.fromstring("<root><first><second><third>Child Node</third></second></first></root>")
     root_two = etree.fromstring("<root><second><third>Child Node</third></second></root>")
     matches = match(root_one, root_two)
     self.assertEqual(2, len(matches))
コード例 #2
0
ファイル: test_xtdiff.py プロジェクト: willbarton/xtdiff
 def test_match_direct(self):
     # Direct match
     root_one = etree.fromstring("<root><first><second>Child Node</second></first></root>")
     root_two = etree.fromstring("<root><first><second>Child Node</second></first></root>")
     matches = match(root_one, root_two)
     self.assertEqual(3, len(matches))
コード例 #3
0
ファイル: test_xtdiff.py プロジェクト: willbarton/xtdiff
 def test_match_below_threshold(self):
     # Should won't meet the threshold
     root_one = etree.fromstring("<root><first><second>asdfghjkl</second></first></root>")
     root_two = etree.fromstring("<root><first><second>zxcvbnm</second></first></root>")
     matches = match(root_one, root_two)
     self.assertEqual(0, len(matches))
コード例 #4
0
ファイル: test_xtdiff.py プロジェクト: willbarton/xtdiff
 def test_match_nothing(self):
     root_one = etree.fromstring("<root><first><second>asdfghjkl</second></first></root>")
     root_two = etree.fromstring("<root><first><second><fourth>zxcvbnm</fourth></second></first></root>")
     matches = match(root_one, root_two)
     self.assertEqual(0, len(matches))