Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Don't assume that httplib2 responses contain any preset attributes, s…
…ince they are looked up dynamically from a response headers dict. Fixes #93
  • Loading branch information
aliafshar committed May 19, 2014
commit 4dd8f6785d74abc8e5760033d35cfb7550e7f6b5
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):

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

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