Skip to content

Commit

Permalink
Fix missing coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycrosley committed Jul 5, 2017
1 parent 170c97a commit 556114d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[report]
include = hug/*.py
omit = hug/development_runner.py
exclude_lines = def hug
def serve
def _start_api
Expand Down
4 changes: 3 additions & 1 deletion tests/test_routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,13 @@ def test_cache(self):
def test_allow_origins(self):
"""Test to ensure it's easy to expose route to other resources"""
assert self.route.allow_origins().route['response_headers']['Access-Control-Allow-Origin'] == '*'
test_headers = self.route.allow_origins('google.com', methods=('GET', 'POST'), credentials=True, headers="OPTIONS").route['response_headers']
test_headers = self.route.allow_origins('google.com', methods=('GET', 'POST'), credentials=True,
headers="OPTIONS", max_age=10).route['response_headers']
assert test_headers['Access-Control-Allow-Origin'] == 'google.com'
assert test_headers['Access-Control-Allow-Methods'] == 'GET, POST'
assert test_headers['Access-Control-Allow-Credentials'] == 'true'
assert test_headers['Access-Control-Allow-Headers'] == 'OPTIONS'
assert test_headers['Access-Control-Max-Age'] == 10


class TestStaticRouter(TestHTTPRouter):
Expand Down

0 comments on commit 556114d

Please sign in to comment.