Add reallife example

This commit is contained in:
Mehdi Abaakouk 2015-08-18 16:56:04 +02:00
parent d39681f388
commit 47e6531f0d
1 changed files with 12 additions and 1 deletions

View File

@ -80,7 +80,18 @@ class TestJsonpath_rw_ext(testscenarios.WithScenarios,
{'cow': 8, 'cat': 3}]},
target=[{'cow': 8, 'cat': 2},
{'cow': 7, 'cat': 2}])),
('real_life_example1', dict(
string="payload.metrics[?(@.name='cpu.frequency')].value",
data={'payload': {'metrics': [
{'timestamp': '2013-07-29T06:51:34.472416',
'name': 'cpu.frequency',
'value': 1600,
'source': 'libvirt.LibvirtDriver'},
{'timestamp': '2013-07-29T06:51:34.472416',
'name': 'cpu.user.time',
'value': 17421440000000,
'source': 'libvirt.LibvirtDriver'}]}},
target=[1600])),
]
def test_fields_value(self):