Skip to content

Commit

Permalink
add test for user agent format
Browse files Browse the repository at this point in the history
also removed spurious empty line
  • Loading branch information
Silvano Luciani committed Oct 1, 2014
1 parent 06ef0db commit 9a5364b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion gcloud/connection.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from pkg_resources import get_distribution
import httplib2

Expand Down
6 changes: 6 additions & 0 deletions gcloud/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 9a5364b

Please sign in to comment.