Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
fix: avoid the new webpush validation in these tests (#781)
Browse files Browse the repository at this point in the history
they lack the right mocks for them (as of d963d18)

fixes #780
  • Loading branch information
pjenvey authored and bbangert committed Jan 10, 2017
1 parent d963d18 commit 5266bb7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions autopush/tests/test_web_validation.py
Expand Up @@ -326,7 +326,7 @@ def test_no_headers(self):
public_key="",
)
schema.context["settings"].router.get_uaid.return_value = dict(
router_type="webpush",
router_type="gcm",
)
data = self._make_test_data(body="asdfasdf")

Expand Down Expand Up @@ -422,7 +422,7 @@ def test_invalid_header_combo(self):
public_key="",
)
schema.context["settings"].router.get_uaid.return_value = dict(
router_type="webpush",
router_type="gcm",
)
info = self._make_test_data(
headers={
Expand All @@ -445,7 +445,7 @@ def test_invalid_header_combo_04(self):
public_key="",
)
schema.context["settings"].router.get_uaid.return_value = dict(
router_type="webpush",
router_type="gcm",
)
info = self._make_test_data(
headers={
Expand All @@ -471,7 +471,7 @@ def test_missing_encryption_salt(self):
public_key="",
)
schema.context["settings"].router.get_uaid.return_value = dict(
router_type="webpush",
router_type="gcm",
)
info = self._make_test_data(
headers={
Expand All @@ -495,7 +495,7 @@ def test_missing_encryption_salt_04(self):
public_key="",
)
schema.context["settings"].router.get_uaid.return_value = dict(
router_type="webpush",
router_type="gcm",
)
info = self._make_test_data(
headers={
Expand All @@ -519,7 +519,7 @@ def test_missing_encryption_key_dh(self):
public_key="",
)
schema.context["settings"].router.get_uaid.return_value = dict(
router_type="webpush",
router_type="gcm",
)
info = self._make_test_data(
headers={
Expand Down Expand Up @@ -634,7 +634,7 @@ def test_invalid_dh_value_for_01_crypto(self):
public_key="",
)
schema.context["settings"].router.get_uaid.return_value = dict(
router_type="webpush",
router_type="gcm",
)

padded_value = "asdfjiasljdf==="
Expand Down Expand Up @@ -691,7 +691,7 @@ def test_invalid_topic(self):
public_key="",
)
schema.context["settings"].router.get_uaid.return_value = dict(
router_type="webpush",
router_type="gcm",
uaid=dummy_uaid,
)

Expand Down
2 changes: 1 addition & 1 deletion autopush/web/base.py
Expand Up @@ -68,7 +68,7 @@ def _call_func(self, result, func, request_handler, *args, **kwargs):
return func(request_handler, *args, **kwargs)

def _track_validation_timing(self, result, request_handler, start_time):
# type: (Any, BaseWebHandler, float) -> None
# type: (Any, BaseWebHandler, float) -> Any
"""Track the validation timing"""
request_handler._timings["validation_time"] = time.time() - start_time
return result
Expand Down

0 comments on commit 5266bb7

Please sign in to comment.