Skip to content

Commit

Permalink
Test of accessing non-existing static resource added
Browse files Browse the repository at this point in the history
Related: aio-libs#921
  • Loading branch information
Alexander Koshevoy authored and Alexander Koshevoy committed Aug 15, 2016
1 parent d501db4 commit ed66eeb
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/test_web_urldispatcher.py
Expand Up @@ -73,6 +73,24 @@ def test_access_root_of_static_handler(tmp_dir_path, create_app_and_client,
yield from r.release()


@pytest.mark.run_loop
def test_access_non_existing_resource(tmp_dir_path, create_app_and_client):
"""
Tests accessing non-existing resource
Try to access a non-exiting resource and make sure that 404 HTTP status
returned.
"""
app, client = yield from create_app_and_client()

# Register global static route:
app.router.add_static('/', tmp_dir_path, show_index=True)

# Request the root of the static directory.
r = yield from client.get('/non_existing_resource')
assert r.status == 404
yield from r.release()


@pytest.mark.run_loop
def test_partialy_applied_handler(create_app_and_client):
app, client = yield from create_app_and_client()
Expand Down

0 comments on commit ed66eeb

Please sign in to comment.