Skip to content

Commit

Permalink
Improve tests coverage
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 18, 2016
1 parent ee18fe3 commit bf307e3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test_web_urldispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,26 @@ def test_unauthorized_folder_access(tmp_dir_path, create_app_and_client):
yield from r.release()


@pytest.mark.run_loop
def test_access_symlink_loop(tmp_dir_path, create_app_and_client):
"""
Tests the access to a looped symlink, which could not be resolved.
"""
my_dir_path = os.path.join(tmp_dir_path, 'my_symlink')
os.symlink(my_dir_path, my_dir_path)

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('/my_symlink')
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 bf307e3

Please sign in to comment.