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

Commit

Permalink
fix: use the right channel_id value in client_info
Browse files Browse the repository at this point in the history
also quiet boto3's logging for tests

Closes: #1059
  • Loading branch information
pjenvey committed Nov 15, 2017
1 parent 7289761 commit bb3be77
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion autopush/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@


def setUp():
logging.getLogger('boto').setLevel(logging.CRITICAL)
for name in ('boto', 'boto3', 'botocore'):
logging.getLogger(name).setLevel(logging.CRITICAL)
global ddb_process
cmd = " ".join([
"java", "-Djava.library.path=%s" % ddb_lib_dir,
Expand Down
4 changes: 3 additions & 1 deletion autopush/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
)
from autopush.logging import begin_or_register
from autopush.main import ConnectionApplication, EndpointApplication
from autopush.utils import base64url_encode
from autopush.utils import base64url_encode, normalize_id
from autopush.metrics import SinkMetrics, DatadogMetrics
from autopush.tests.support import TestingLogObserver
from autopush.websocket import PushServerFactory
Expand Down Expand Up @@ -434,6 +434,8 @@ def test_webpush_data_delivery_to_connected_client(self):
assert result["channelID"] == chan
assert result["data"] == "wyigoeIooQ"
assert self.logs.logged_ci(lambda ci: 'message_size' in ci)
assert self.logs.logged_ci(
lambda ci: normalize_id(ci['channel_id']) == chan)
assert self.logs.logged_ci(
lambda ci: ci['encoding'] == "aesgcm"
)
Expand Down
2 changes: 1 addition & 1 deletion autopush/web/webpush.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ def post(self,
self._client_info.update(
message_id=notification.message_id,
uaid_hash=hasher(user_data.get("uaid")),
channel_id=user_data.get("chid"),
channel_id=notification.channel_id.hex,
router_key=user_data["router_type"],
message_size=notification.data_length,
message_ttl=notification.ttl,
Expand Down

0 comments on commit bb3be77

Please sign in to comment.