예제 #1
0
파일: test_ypath.py 프로젝트: bgnori/bookdb
 def testValueEq1(self):
     xs = ypath.find("//.[x=3]", self.y)
     self.assertIn(self.y["c"], xs)
     self.assertIn(self.y["e"], xs)
예제 #2
0
파일: test_ypath.py 프로젝트: bgnori/bookdb
 def testValueEq2(self):
     xs = ypath.find("//.[y=6]", self.y)
     self.assertIn(self.y["d"], xs)
     self.assertIn(self.y["e"], xs)
예제 #3
0
파일: test_ypath.py 프로젝트: bgnori/bookdb
 def testSingleIndex2(self):
     x = ypath.find("/1", self.z)
     self.assertEqual(self.z[1], x)
예제 #4
0
파일: test_ypath.py 프로젝트: bgnori/bookdb
 def testNameAfterIndex(self):
     x = ypath.find("/2/second", self.z)
     self.assertEqual(self.z[2]["second"], x)
예제 #5
0
파일: test_ypath.py 프로젝트: bgnori/bookdb
 def testSingleIndex1(self):
     x = ypath.find("/0", self.z)
     self.assertEqual(self.z[0], x)
예제 #6
0
파일: test_ypath.py 프로젝트: bgnori/bookdb
 def testIndexAfterName(self):
     x = ypath.find("/c/0", self.y)
     self.assertEqual(self.y["c"][0], x)
예제 #7
0
파일: test_ypath.py 프로젝트: bgnori/bookdb
 def testSingleName2(self):
     x = ypath.find("/b", self.y)
     self.assertEqual(self.y["b"], x)
예제 #8
0
파일: test_ypath.py 프로젝트: bgnori/bookdb
 def testSingleName1(self):
     x = ypath.find("/a", self.y)
     self.assertEqual(self.y["a"], x)
예제 #9
0
파일: test_ypath.py 프로젝트: bgnori/bookdb
 def testRoot(self):
     root = ypath.find("/", self.y)
     self.assertEqual(self.y, root)