MCPcopy Create free account
hub / github.com/celery/celery / test_basic_task

Method test_basic_task

t/integration/test_tasks.py:81–103  ·  view source on GitHub ↗

Tests basic task call

(self, manager)

Source from the content-addressed store, hash-verified

79
80 @flaky
81 def test_basic_task(self, manager):
82 """Tests basic task call"""
83 results = []
84 # Tests calling task only with args
85 for i in range(10):
86 results.append([i + i, add.delay(i, i)])
87 for expected, result in results:
88 value = result.get(timeout=10)
89 assert value == expected
90 assert result.status == 'SUCCESS'
91 assert result.ready() is True
92 assert result.successful() is True
93
94 results = []
95 # Tests calling task with args and kwargs
96 for i in range(10):
97 results.append([3*i, add.delay(i, i, z=i)])
98 for expected, result in results:
99 value = result.get(timeout=10)
100 assert value == expected
101 assert result.status == 'SUCCESS'
102 assert result.ready() is True
103 assert result.successful() is True
104
105 def test_task_sent_event_respects_publish_retry_limit(self, manager, monkeypatch):
106 app = manager.app

Callers

nothing calls this directly

Calls 4

delayMethod · 0.45
getMethod · 0.45
readyMethod · 0.45
successfulMethod · 0.45

Tested by

no test coverage detected