Skip to content

Commit

Permalink
Merge pull request googleapis#94 from aliafshar/93
Browse files Browse the repository at this point in the history
Don't assume that httplib2 responses contain any preset attributes, sinc...
  • Loading branch information
Ali Afshar committed May 21, 2014
2 parents 87c3e73 + 4dd8f67 commit af92e74
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gcloud/storage/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def __init__(self, response, content):
class NotFoundError(ConnectionError):

def __init__(self, response, content):
self.message = 'GET %s returned a 404.' % (response.url)
self.message = 'Request returned a 404. Headers: %s' % (response)


class StorageDataError(StorageError):
Expand Down
11 changes: 10 additions & 1 deletion gcloud/storage/test_connection.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import unittest2

from gcloud.storage.connection import Connection

from gcloud.storage.exceptions import NotFoundError

class TestConnection(unittest2.TestCase):

def test_init(self):
connection = Connection('project-name')
self.assertEqual('project-name', connection.project)


class TestExceptions(unittest2.TestCase):

def test_not_found_always_prints(self):
e = NotFoundError({}, None)
self.assertEqual('', str(e))


0 comments on commit af92e74

Please sign in to comment.