is_false in yaml can also mean does not exist

This commit is contained in:
Honza Kral
2013-07-11 02:31:40 +02:00
parent 480b147b63
commit 30242ad277
@@ -59,6 +59,8 @@ class YamlTestCase(TestCase):
# fetch the possibly nested value from last_response
value = self.last_response
for step in path.split('.'):
if not step:
continue
if step.isdigit():
step = int(step)
self.assertIsInstance(value, list)
@@ -137,6 +139,14 @@ class YamlTestCase(TestCase):
for key, value in action.items():
self._state[value] = self._lookup(key)
def run_is_false(self, action):
try:
value = self._lookup(action)
except AssertionError:
pass
else:
self.assertFalse(value)
def run_is_true(self, action):
value = self._lookup(action)
self.assertTrue(value)