From 876c3825b21d073108ff9d75c53caf5e047d4f4c Mon Sep 17 00:00:00 2001 From: Philip Jenvey Date: Wed, 11 Jan 2017 14:57:19 -0800 Subject: [PATCH] feat: log the python version in client_info (#778) fixes #769 --- autopush/base.py | 2 ++ autopush/tests/test_integration.py | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/autopush/base.py b/autopush/base.py index ad494332..508f3ca2 100644 --- a/autopush/base.py +++ b/autopush/base.py @@ -1,3 +1,4 @@ +import sys import uuid import cyclone.web @@ -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): diff --git a/autopush/tests/test_integration.py b/autopush/tests/test_integration.py index b0961a0d..bddeb2ad 100644 --- a/autopush/tests/test_integration.py +++ b/autopush/tests/test_integration.py @@ -5,6 +5,7 @@ import random import signal import subprocess +import sys import time import urlparse import uuid @@ -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