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

Commit

Permalink
feat: log the python version in client_info (#778)
Browse files Browse the repository at this point in the history
fixes #769
  • Loading branch information
pjenvey authored and bbangert committed Jan 11, 2017
1 parent 7b25bae commit 876c382
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions autopush/base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
import uuid

import cyclone.web
Expand Down Expand Up @@ -25,6 +26,7 @@ def _init_info(self):
authorization=self.request.headers.get('authorization', ""),
message_ttl=self.request.headers.get('ttl', ""),
uri=self.request.uri,
python_version=sys.version,
)

def write_error(self, code, **kwargs):
Expand Down
10 changes: 10 additions & 0 deletions autopush/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import random
import signal
import subprocess
import sys
import time
import urlparse
import uuid
Expand Down Expand Up @@ -635,6 +636,15 @@ def test_basic_last_connect(self):
log.debug("Last connected time: %s", c.get("last_connect", "None"))
eq_(True, has_connected_this_month(c))

@inlineCallbacks
def test_endpoint_client_info(self):
client = yield self.quick_register()
result = yield client.send_notification()
ok_(result is not None)
ok_(self.logs.logged_ci(
lambda ci: ci['python_version'] == sys.version))
yield self.shut_down(client)


class TestData(IntegrationBase):
@inlineCallbacks
Expand Down

0 comments on commit 876c382

Please sign in to comment.