From 3bc16ac24091009e73d9c4b9c2fbda0cdca6cff5 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 19 Jan 2018 17:29:47 +0200 Subject: Add: yarn scenario for building two project sequentially --- yarns/900-implements.yarn | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'yarns/900-implements.yarn') diff --git a/yarns/900-implements.yarn b/yarns/900-implements.yarn index 39b590b..b27b830 100644 --- a/yarns/900-implements.yarn +++ b/yarns/900-implements.yarn @@ -139,3 +139,30 @@ along with this program. If not, see . value = get_next_match() headers = vars['headers'] assertEqual(headers[name].lower(), value.lower()) + + IMPLEMENTS THEN result is step (.+) + step = json.loads(get_next_match()) + body = json.loads(vars['body']) + actual_step = body['step'] + print('expected step', step) + print('actual body', body) + print('actual step', actual_step) + diff = dict_diff(step, actual_step) + print('diff', diff) + assertEqual(diff, None) + + IMPLEMENTS WHEN (\S+) requests list of builds + user = get_next_match() + token = get_token(user) + url = vars['url'] + path = '/builds' + http(vars, get, url + path, token=token) + + IMPLEMENTS THEN the list of builds is (.+) + expected = json.loads(get_next_match()) + print('expected', expected) + body = json.loads(vars['body']) + print('body', body) + actual = [o['build_id'] for o in body['builds']] + print('actual', actual) + assertEqual(actual, expected) -- cgit v1.2.1