Updated model and mockmodel tests to account for JSON responses in place of the string
responses that were returned before.
Signed-off-by: Adam King <rak(a)linux.vnet.ibm.com>
---
tests/test_mockmodel.py | 2 +-
tests/test_model.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/test_mockmodel.py b/tests/test_mockmodel.py
index 4ac08dd..ab5eb59 100644
--- a/tests/test_mockmodel.py
+++ b/tests/test_mockmodel.py
@@ -149,7 +149,7 @@ class MockModelTests(unittest.TestCase):
self.assertEquals(1024, info['memory'])
self.assertEquals(1, info['cpus'])
self.assertEquals('images/icon-vm.png', info['icon'])
- self.assertEquals(stats_keys, set(eval(info['stats']).keys()))
+ self.assertEquals(stats_keys, set(info['stats'].keys()))
self.assertEquals('vnc', info['graphics']['type'])
self.assertEquals('0.0.0.0', info['graphics']['listen'])
diff --git a/tests/test_model.py b/tests/test_model.py
index 298a39e..d3315a0 100644
--- a/tests/test_model.py
+++ b/tests/test_model.py
@@ -67,7 +67,7 @@ class ModelTests(unittest.TestCase):
self.assertEquals(2048, info['memory'])
self.assertEquals(2, info['cpus'])
self.assertEquals(None, info['icon'])
- self.assertEquals(stats_keys, set(eval(info['stats']).keys()))
+ self.assertEquals(stats_keys, set(info['stats'].keys()))
self.assertRaises(NotFoundError, inst.vm_lookup, 'nosuchvm')
@unittest.skipUnless(utils.running_as_root(), 'Must be run as root')
--
1.8.1.4