Fix some other tests broken by the new HttpError implementation

This commit is contained in:
Joe Gregorio
2011-01-04 09:51:45 -05:00
parent a14f016e3c
commit d4e1456dad
3 changed files with 2 additions and 3 deletions

View File

@@ -45,7 +45,6 @@ class HttpError(Error):
__str__ = __repr__ __str__ = __repr__
class UnknownLinkType(Error): class UnknownLinkType(Error):
"""Link type unknown or unexpected.""" """Link type unknown or unexpected."""
pass pass

View File

@@ -114,7 +114,7 @@ class Model(unittest.TestCase):
model = JsonModel() model = JsonModel()
resp = httplib2.Response({'status': '401'}) resp = httplib2.Response({'status': '401'})
resp.reason = 'Unauthorized' resp.reason = 'Unauthorized'
content = '{"error": "not authorized"}' content = '{"error": {"message": "not authorized"}}'
try: try:
content = model.response(resp, content) content = model.response(resp, content)

View File

@@ -61,7 +61,7 @@ class Mocks(unittest.TestCase):
activity = buzz.activities().list(scope='@self', userId='@me').execute() activity = buzz.activities().list(scope='@self', userId='@me').execute()
self.fail('An exception should have been thrown') self.fail('An exception should have been thrown')
except HttpError, e: except HttpError, e:
self.assertEqual('500 Server Error', e.detail) self.assertEqual('{}', e.content)
self.assertEqual(500, e.resp.status) self.assertEqual(500, e.resp.status)
self.assertEqual('Server Error', e.resp.reason) self.assertEqual('Server Error', e.resp.reason)