コード例 #1
0
ファイル: test_json_patch.py プロジェクト: treycucco/bidon
 def test_find_all(self):
   doc = dict(
     person=dict(
       name="Trey",
       things=[
         dict(id=1, name="One"),
         dict(id=2, name="Two")
       ]))
   self.assertEqual(set(jp.find_all(doc, "/person/things/*/name")), {"One", "Two"})
コード例 #2
0
ファイル: transform.py プロジェクト: treycucco/bidon
def get_json_vals(source, path):
  """Get all the nested values identified by the json path, rooted at source."""
  yield from JP.find_all(source, path)