summaryrefslogtreecommitdiff
path: root/yarns
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-10-05 15:45:17 +0300
committerLars Wirzenius <liw@liw.fi>2017-10-05 18:02:44 +0300
commit693a8507169e199f3b5e4ef64b03680d42e1c7b0 (patch)
tree0bc0f8396fe138d87df0bceada819813eaec64c8 /yarns
parent2018a4435fb3adac67d9c3e2ef62a25fa5e90668 (diff)
downloadqvisqve-693a8507169e199f3b5e4ef64b03680d42e1c7b0.tar.gz
Fix: implements to provide debugging output, be simpler code
Diffstat (limited to 'yarns')
-rw-r--r--yarns/900-implements.yarn25
1 files changed, 10 insertions, 15 deletions
diff --git a/yarns/900-implements.yarn b/yarns/900-implements.yarn
index 2c79768..f760e20 100644
--- a/yarns/900-implements.yarn
+++ b/yarns/900-implements.yarn
@@ -199,24 +199,19 @@ Start a Qvarn running in the background.
IMPLEMENTS THEN search result at index (\d+) has id (\S+)
import json
- index = get_next_match()
+ index = int(get_next_match())
id_name = get_next_match()
body = json.loads(vars['body'])
print 'body', repr(body)
- print 'resources', repr(body['resources'])
- print 'at index', repr(body['resources'][index])
- print 'id', repr(body['resources'][index]['id'])
- vars[id_name] = body['resources'][index]['id']
-
- found = False
- for result in actual['resources']:
- if values_match(wanted, result):
- print 'MATCH!', repr(wanted), repr(result)
- found = True
- break
- print 'no match', repr(wanted), repr(result)
- assertTrue(found)
-
+ resources = body['resources']
+ print 'resources', repr(resources)
+ print 'len resources', len(resources)
+ print 'index', index
+ assert index < len(resources)
+ obj = resources[index]
+ print 'resource at index', repr(obj)
+ print 'id', repr(obj['id'])
+ vars[id_name] = obj['id']
IMPLEMENTS THEN response has header WWW-Authenticate containing "(.+)"
assert 0