(self)
| 262 | class test_chord(ChordCase): |
| 263 | |
| 264 | def test_eager(self): |
| 265 | from celery import chord |
| 266 | |
| 267 | @self.app.task(shared=False) |
| 268 | def addX(x, y): |
| 269 | return x + y |
| 270 | |
| 271 | @self.app.task(shared=False) |
| 272 | def sumX(n): |
| 273 | return sum(n) |
| 274 | |
| 275 | self.app.conf.task_always_eager = True |
| 276 | x = chord(addX.s(i, i) for i in range(10)) |
| 277 | body = sumX.s() |
| 278 | result = x(body) |
| 279 | assert result.get() == sum(i + i for i in range(10)) |
| 280 | |
| 281 | def test_apply(self): |
| 282 | self.app.conf.task_always_eager = False |