Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't assume that httplib2 responses contain any preset attributes, sinc... #94

Merged
merged 1 commit into from
May 21, 2014
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
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))