diff options
author | Lars Wirzenius <liw@liw.fi> | 2018-11-05 10:36:02 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2018-11-05 10:36:02 +0200 |
commit | 82aa16698668375881e9edcab46965e4be3f5b83 (patch) | |
tree | 855cb8434e8cee343c1d7435337fe3af440a217f /yarns/900-implements.yarn | |
parent | 782d42ef1ee0c7edb2a9cf68a24ea5ba60eca8cc (diff) | |
download | muck-poc-82aa16698668375881e9edcab46965e4be3f5b83.tar.gz |
Add: owner metadata
Diffstat (limited to 'yarns/900-implements.yarn')
-rw-r--r-- | yarns/900-implements.yarn | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/yarns/900-implements.yarn b/yarns/900-implements.yarn index 227be26..c81d1ef 100644 --- a/yarns/900-implements.yarn +++ b/yarns/900-implements.yarn @@ -17,22 +17,22 @@ IMPLEMENTS WHEN user (\S+) makes request POST /res with body (.*) user = get_expanded_match() body = get_expanded_match() - POST('/res', {}, json.loads(body)) + POST(user, '/res', {}, json.loads(body)) IMPLEMENTS WHEN user (\S+) makes request GET /res with header "(\S+): (.+)" user = get_expanded_match() header = get_expanded_match() value = get_expanded_match() - GET('/res', {header:value}) + GET(user, '/res', {header:value}) IMPLEMENTS WHEN user (\S+) makes request GET /status user = get_expanded_match() - GET('/status', {}) + GET(user, '/status', {}) IMPLEMENTS WHEN user (\S+) makes request GET /search with body (.+) user = get_expanded_match() body = json.loads(get_expanded_match()) - GET('/search', {}, body=body) + GET(user, '/search', {}, body=body) IMPLEMENTS WHEN user (\S+) makes request PUT /res with header "(\S+): (.+)" and header "(\S+): (.+)" and body (.+) user = get_expanded_match() @@ -45,13 +45,13 @@ header1: value1, header2: value2, } - PUT('/res', headers, json.loads(body)) + PUT(user, '/res', headers, json.loads(body)) IMPLEMENTS WHEN user (\S+) makes request DELETE /res with header "(\S+): (.+)" user = get_expanded_match() header = get_expanded_match() value = get_expanded_match() - DELETE('/res', {header:value}) + DELETE(user, '/res', {header:value}) ## Checking HTTP responses @@ -70,7 +70,12 @@ IMPLEMENTS THEN response has header "(\S+): (.+)" name = get_next_match() expected = get_expanded_match() - assertEqual(get_header(name), expected) + actual = get_header(name) + print 'header:', name + print 'actual:', repr(actual) + print 'expected:', repr(expected) + print 'response headers:', V['response_headers'] + assertEqual(actual, expected) IMPLEMENTS THEN response body is (.+) expected = get_expanded_match() |