diff options
author | Josh Blum | 2013-06-01 14:56:00 -0700 |
---|---|---|
committer | Josh Blum | 2013-06-01 14:56:00 -0700 |
commit | 618c0467762e3610f7e2afa48016183ff3a67060 (patch) | |
tree | aaeff5d5bb51b44fbf41d2a5a8bf0a7100335ed3 /tests | |
parent | e0de6c31bbc3d0cde7b5907beb952d9411fd2d13 (diff) | |
download | sandhi-618c0467762e3610f7e2afa48016183ff3a67060.tar.gz sandhi-618c0467762e3610f7e2afa48016183ff3a67060.tar.bz2 sandhi-618c0467762e3610f7e2afa48016183ff3a67060.zip |
props: added prop query to blocks + qa test
Diffstat (limited to 'tests')
-rw-r--r-- | tests/query_test.py | 17 |
1 files changed, 12 insertions, 5 deletions
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() |