| 110 | |
| 111 | |
| 112 | class CountCancel: |
| 113 | def __init__(self, at=0, failure=None): |
| 114 | self.at = at |
| 115 | self.failure = failure |
| 116 | self.calls = 0 |
| 117 | |
| 118 | def __call__(self, context): |
| 119 | self.calls += 1 |
| 120 | if self.at and self.calls >= self.at: |
| 121 | if self.failure is not None: |
| 122 | raise self.failure |
| 123 | return True |
| 124 | return False |
| 125 | |
| 126 | |
| 127 | class DependencyControl(unittest.TestCase): |
no outgoing calls