From 9a5364ba957be37310d6a09852d44a1f94dd63db Mon Sep 17 00:00:00 2001 From: Silvano Luciani Date: Wed, 1 Oct 2014 16:16:55 -0700 Subject: [PATCH] add test for user agent format also removed spurious empty line --- gcloud/connection.py | 1 - gcloud/test_connection.py | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gcloud/connection.py b/gcloud/connection.py index ff429172647ba..fac707d5fcde7 100644 --- a/gcloud/connection.py +++ b/gcloud/connection.py @@ -1,4 +1,3 @@ - from pkg_resources import get_distribution import httplib2 diff --git a/gcloud/test_connection.py b/gcloud/test_connection.py index 1e0ebb8f690fd..1a9b274e91a58 100644 --- a/gcloud/test_connection.py +++ b/gcloud/test_connection.py @@ -43,3 +43,9 @@ def authorize(self, http): conn = self._makeOne(creds) self.assertTrue(conn.http is authorized) self.assertTrue(isinstance(creds._called_with, Http)) + + def test_user_agent_format(self): + from pkg_resources import get_distribution + expected_ua = 'gcloud-python/{0}'.format(get_distribution('gcloud').version) + conn = self._makeOne() + self.assertEqual(conn.USER_AGENT, expected_ua)