def test_put_01_create(self): data = 'goodbye world' status, msg, body = httpc.put_(self.base_url() + 'goodbye', data=data) self.assertEquals(status, 201) self.assertEquals(msg.dict['x-put'], 'hello') self.assertEquals(body, '') self.assertEquals(httpc.get(self.base_url() + 'goodbye'), data)
def test_put_02_modify(self): self.test_put_01_create() data = 'i really mean goodbye' status = httpc.put_(self.base_url() + 'goodbye', data=data)[0] self.assertEquals(status, 204) self.assertEquals(httpc.get(self.base_url() + 'goodbye'), data)