コード例 #1
0
ファイル: test_csv_builder.py プロジェクト: riboh/onadata
 def test_prefix_from_xpath(self):
     xpath = "parent/child/grandhild"
     prefix = get_prefix_from_xpath(xpath)
     self.assertEqual(prefix, 'parent/child/')
     xpath = "parent/child"
     prefix = get_prefix_from_xpath(xpath)
     self.assertEqual(prefix, 'parent/')
     xpath = "parent"
     prefix = get_prefix_from_xpath(xpath)
     self.assertTrue(prefix is None)
コード例 #2
0
 def test_prefix_from_xpath(self):
     xpath = "parent/child/grandhild"
     prefix = get_prefix_from_xpath(xpath)
     self.assertEqual(prefix, 'parent/child/')
     xpath = "parent/child"
     prefix = get_prefix_from_xpath(xpath)
     self.assertEqual(prefix, 'parent/')
     xpath = "parent"
     prefix = get_prefix_from_xpath(xpath)
     self.assertTrue(prefix is None)