Skip to content

Commit

Permalink
test float handling
Browse files Browse the repository at this point in the history
  • Loading branch information
r0fls committed Jan 13, 2019
1 parent 7067295 commit 6dfafb0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_cookies.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def handler(request):
assert response.cookies["test"].value == "pass"


@pytest.mark.parametrize("max_age", ["0", 30, "30", "test"])
@pytest.mark.parametrize("max_age", ["0", 30, 30.0, 30.1, "30", "test"])
def test_cookie_max_age(app, max_age):
cookies = {"test": "wait"}

Expand All @@ -154,7 +154,7 @@ def handler(request):

assert response.cookies["test"].value == "pass"

if str(max_age).isdigit():
if str(max_age).isdigit() and int(max_age) == float(max_age):
assert response.cookies["test"]["max-age"] == str(max_age)
else:
assert response.cookies["test"]["max-age"] == str(DEFAULT_MAX_AGE)
Expand Down

0 comments on commit 6dfafb0

Please sign in to comment.