summaryrefslogtreecommitdiff
path: root/morphlib/morph2_tests.py
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-05-09 17:45:36 +0100
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-05-09 17:45:36 +0100
commita1305ad1e8f0496b42a6037ed114523d963d9698 (patch)
tree76126b410dfb30fdfdc502fece9285411a7b5d4b /morphlib/morph2_tests.py
parentf01be2d4e2804578e4e66d692362dd15f9ef5a6b (diff)
downloadmorph-a1305ad1e8f0496b42a6037ed114523d963d9698.tar.gz
Add a Morphology.keys() method
Diffstat (limited to 'morphlib/morph2_tests.py')
-rw-r--r--morphlib/morph2_tests.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/morphlib/morph2_tests.py b/morphlib/morph2_tests.py
index a862a3a8..0d3e7168 100644
--- a/morphlib/morph2_tests.py
+++ b/morphlib/morph2_tests.py
@@ -79,3 +79,16 @@ class MorphologyTests(unittest.TestCase):
self.assertEqual(m['disk-size'], 1024**3)
+ def test_returns_dict_keys(self):
+ m = Morphology('''
+ {
+ "name": "foo",
+ "kind": "system",
+ "disk-size": "1g"
+ }
+ ''')
+
+ self.assertTrue('name' in m.keys())
+ self.assertTrue('kind' in m.keys())
+ self.assertTrue('disk-size' in m.keys())
+