From 618c0467762e3610f7e2afa48016183ff3a67060 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sat, 1 Jun 2013 14:56:00 -0700 Subject: props: added prop query to blocks + qa test --- tests/query_test.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'tests/query_test.py') diff --git a/tests/query_test.py b/tests/query_test.py index 1038712..5c37bad 100644 --- a/tests/query_test.py +++ b/tests/query_test.py @@ -46,11 +46,16 @@ class QueryTest(unittest.TestCase): blocks_json = self.tb.query("<args><path>/blocks.json</path></args>") print blocks_json - json.loads(blocks_json) + blocks_python = json.loads(blocks_json) + print blocks_python + self.assertEqual(len(blocks_python['blocks']), 2) stats_json = self.tb.query("<args><path>/stats.json</path></args>") print stats_json - json.loads(stats_json) + stats_python = json.loads(stats_json) + print stats_python + self.assertTrue('tps' in stats_python) + self.assertTrue('now' in stats_python) def test_props(self): vec_source = VectorSource(numpy.uint32, [0, 9, 8, 7, 6]) @@ -59,9 +64,11 @@ class QueryTest(unittest.TestCase): self.tb.connect(vec_source, block, vec_sink) self.tb.run() - props_json = self.tb.query("<args><path>/props.json</path></args>") - print props_json - json.loads(props_json) + blocks_json = self.tb.query("<args><path>/blocks.json</path></args>") + print blocks_json + blocks_python = json.loads(blocks_json) + print blocks_python + self.assertEqual(len(blocks_python['blocks']), 3) if __name__ == '__main__': unittest.main() -- cgit