MCPcopy
hub / github.com/jarun/buku / assert_response

Function assert_response

tests/test_views.py:142–149  ·  view source on GitHub ↗
(response, uri, *, status=200, argnames=None, args=None)

Source from the content-addressed store, hash-verified

140 assert not dom.xpath('//script[contains(., "const SUCCESS = [")][contains(., "/bookmark/details/?id=")]')
141
142def assert_response(response, uri, *, status=200, argnames=None, args=None):
143 assert response.status_code == status
144 assert response.request.path == uri
145 if argnames is not None:
146 assert set(response.request.args) == set(argnames)
147 if args is not None:
148 assert dict(response.request.args) == args
149 return etree.HTML(response.text)
150
151def assert_bookmark(bookmark, query, tags=None):
152 assert bookmark.url == query['link']

Callers 13

test_bookmarklet_viewFunction · 0.70
test_create_and_fetchFunction · 0.70
test_create_redirectFunction · 0.70
test_create_duplicateFunction · 0.70
test_updateFunction · 0.70
test_update_redirectFunction · 0.70
test_deleteFunction · 0.70
test_env_per_pageFunction · 0.70
test_env_readonlyFunction · 0.70
test_env_themeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected