コード例 #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)
コード例 #2
0
ファイル: test_http.py プロジェクト: zhangzewen/celery
 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)
コード例 #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
コード例 #4
0
ファイル: test_http.py プロジェクト: mozilla/firefox-flicks
 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)
コード例 #5
0
ファイル: test_task_http.py プロジェクト: kornholi/celery
 def with_mock_urlopen(_val):
     d = http.URL("http://example.com/mul").post_async(x=10, y=10)
     self.assertEqual(d.get(), 100)