Esempio n. 1
0
 def test_done(self):
     response = ResponseAsync()
     self.assertFalse(response.done(), 'response does not start done')
     std_response = Response(200)
     response.fulfill(std_response)
     self.assertTrue(response.done(),
                     'response is done after call to fulfill')
Esempio n. 2
0
    def test_callback(self):
        def callback(response):
            response.called = True
            self.assertEqual(response.status, 200)

        response = ResponseAsync(callback=callback)
        response.fulfill(Response(200))
        self.assertEqual(response.status, 200)
        self.assertTrue(response.called)
Esempio n. 3
0
    def test_callback(self):
        def callback(response):
            response.called = True
            self.assertEqual(response.status, 200)

        response = ResponseAsync(callback=callback)
        response.fulfill(Response(200))
        self.assertEqual(response.status, 200)
        self.assertTrue(response.called)
Esempio n. 4
0
 def test_done(self):
     response = ResponseAsync()
     self.assertFalse(response.done(), 'response does not start done')
     std_response = Response(200)
     response.fulfill(std_response)
     self.assertTrue(response.done(), 'response is done after call to fulfill')