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

@@ -43,7 +43,6 @@ class HttpError(Error):
return '<HttpError %s "%s">' % (self.resp.status, self._get_reason())
__str__ = __repr__
class UnknownLinkType(Error):

View File

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

View File

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