| 614 | |
| 615 | |
| 616 | class MockAsyncResultSuccess(AsyncResult): |
| 617 | forgotten = False |
| 618 | |
| 619 | def __init__(self, *args, **kwargs): |
| 620 | self._result = kwargs.pop('result', 42) |
| 621 | super().__init__(*args, **kwargs) |
| 622 | |
| 623 | def forget(self): |
| 624 | self.forgotten = True |
| 625 | |
| 626 | @property |
| 627 | def result(self): |
| 628 | return self._result |
| 629 | |
| 630 | @property |
| 631 | def state(self): |
| 632 | return states.SUCCESS |
| 633 | |
| 634 | def get(self, **kwargs): |
| 635 | return self.result |
| 636 | |
| 637 | |
| 638 | class SimpleBackend(SyncBackendMixin): |
no outgoing calls