def test_get_top_level_by_key(self): doc = {'foo': 'bar'} assert rewrite.get_by_key(doc, 'foo') == 'bar'
def test_nested_by_key(self): doc = {'foo': {'bar': {'baz': 'hello world'}}} assert rewrite.get_by_key(doc, 'foo.bar.baz') == 'hello world'