is_false in yaml can also mean does not exist
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user