Skip to content

Commit

Permalink
Add functional test for caching.
Browse files Browse the repository at this point in the history
  • Loading branch information
Koen Van Daele committed Apr 12, 2016
1 parent 473eba5 commit 9daaf17
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,14 @@ def test_uris_two_parameters(self, app):
data = json.loads(res.body.decode('utf-8'))
assert data['uri'] == 'urn:x-barbar:area:51'
assert data['location'] == 'http://localhost:2222/area/51'

def test_uris_caching(self, app):
res = app.get('/uris?uri=http://localhost/foobar/18')
assert 'Cache-Control' in res.headers
assert 'ETag' in res.headers
etag = res.headers['ETag']
res2 = app.get(
'/uris?uri=http://localhost/foobar/18',
headers={'If-None-Match': etag}
)
assert res2.status == '304 Not Modified'

0 comments on commit 9daaf17

Please sign in to comment.