Beispiel #1
0
    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))
Beispiel #2
0
 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'])
Beispiel #3
0
 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'])
Beispiel #4
0
 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))
Beispiel #5
0
 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))