diff options
author | Lars Wirzenius <liw@liw.fi> | 2018-05-28 19:51:58 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2018-06-10 19:44:16 +0300 |
commit | 9759c2b51a1250aa345c21b7cc6b793f4965ac2d (patch) | |
tree | a96339ec340bdb1e7b4bef4cf5cb3a7a4a0754b4 /yarns/900-implements.yarn | |
parent | 269ee474d77a5210288cf33ee9d687c8aaa29de9 (diff) | |
download | ick2-9759c2b51a1250aa345c21b7cc6b793f4965ac2d.tar.gz |
Add: BuildStateMachine class
Diffstat (limited to 'yarns/900-implements.yarn')
-rw-r--r-- | yarns/900-implements.yarn | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/yarns/900-implements.yarn b/yarns/900-implements.yarn index 4086a2f..5468a6c 100644 --- a/yarns/900-implements.yarn +++ b/yarns/900-implements.yarn @@ -108,17 +108,23 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. expected_text = get_next_match() expected = json.loads(expected_text) actual = json.loads(vars['body']) - print('expected', json.dumps(expected, indent=4)) - print('actual', json.dumps(actual, indent=4)) + print 'expected' + json.dump(expected, sys.stdout, indent=4, sort_keys=True) + print + print 'actual' + json.dump(actual, sys.stdout, indent=4, sort_keys=True) + print diff = dict_diff(expected, actual) if diff is not None: print(diff) assert 0 - IMPLEMENTS THEN body text is "(.*)" - expected = unescape(get_next_match()) - actual = vars['body'] - assertEqual(expected, actual) + IMPLEMENTS THEN body text contains "(.*)" + pattern = unescape(get_next_match()) + text = vars['body'] + print 'pattern:', repr(pattern) + print 'text:', text + assertTrue(pattern in text) IMPLEMENTS THEN body is the same as the blob (\S+) filename = get_next_match() @@ -142,10 +148,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. IMPLEMENTS THEN result is step (.+) step = json.loads(get_next_match()) - body = json.loads(vars['body']) - actual_step = body['step'] print('expected step', step) + body = json.loads(vars['body']) print('actual body', body) + actual_step = body['step'] print('actual step', actual_step) diff = dict_diff(step, actual_step) print('diff', diff) |