We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e29cdca commit 50b5e6bCopy full SHA for 50b5e6b
1 file changed
tests/unit/test_handlers.py
@@ -1,6 +1,7 @@
1
# pylint: disable=no-self-use
2
from datetime import date
3
from unittest import mock
4
+from typing import List
5
import pytest
6
7
from allocation.adapters import repository
@@ -126,3 +127,13 @@ def test_reallocates_if_necessary(self):
126
127
assert batch1.available_quantity == 5
128
# and 20 will be reallocated to the next batch
129
assert batch2.available_quantity == 30
130
+
131
132
+class FakeUnitOfWorkWithFakeMessageBus(FakeUnitOfWork):
133
+ def __init__(self):
134
+ super().__init__()
135
+ self.events_published = [] # type: List[events.Event]
136
137
+ def collect_new_events(self):
138
+ self.events_published += super().collect_new_events()
139
+ return []
0 commit comments