def test_message_and_warnings(self): api = APIObject(self.message, warnings = self.warnings) expected = {'response':{'apiobject': self.message}, 'status':'ok', 'warnings':self.warnings} self.assertEquals(expected, api.response) self.assertEquals(json.dumps(self.message),str(api))
def test_message_get_and_get_item(self): api = APIObject(self.message) self.assertEquals(api.get('my'), self.message.get('my')) self.assertEquals(api['my'], self.message['my'])
def test_error(self): api = APIObject(self.message, error =self.error) expected = {'error':self.error} self.assertEquals(expected, api.response) self.assertEquals(json.dumps(self.message),str(api))
def test_message(self): api = APIObject(self.message) expected = {'response':{'apiobject':self.message}, 'status':'ok'} self.assertEquals(expected, api.response) self.assertEquals(json.dumps(self.message),str(api))