Exemplo n.º 1
0
 def test_URL_post_async(self):
     self.app.conf.CELERY_ALWAYS_EAGER = True
     with mock_urlopen(success_response(100)):
         d = http.URL(
             'http://example.com/mul', app=self.app,
         ).post_async(x=10, y=10)
         self.assertEqual(d.get(), 100)
Exemplo n.º 2
0
 def test_URL_post_async(self):
     self.app.conf.task_always_eager = True
     with mock_urlopen(success_response(100)):
         d = http.URL(
             'http://example.com/mul', app=self.app,
         ).post_async(x=10, y=10)
         self.assertEqual(d.get(), 100)
Exemplo n.º 3
0
 def test_URL_post_async(self):
     http.HttpDispatchTask.app.conf.CELERY_ALWAYS_EAGER = True
     try:
         with mock_urlopen(success_response(100)):
             d = http.URL("http://example.com/mul").post_async(x=10, y=10)
             self.assertEqual(d.get(), 100)
     finally:
         http.HttpDispatchTask.app.conf.CELERY_ALWAYS_EAGER = False
Exemplo n.º 4
0
 def test_URL_post_async(self):
     with eager_tasks():
         with mock_urlopen(success_response(100)):
             d = http.URL('http://example.com/mul').post_async(x=10, y=10)
             self.assertEqual(d.get(), 100)
Exemplo n.º 5
0
 def with_mock_urlopen(_val):
     d = http.URL("http://example.com/mul").post_async(x=10, y=10)
     self.assertEqual(d.get(), 100)