Skip to content

Commit 50b5e6b

Browse files
committed
sort-of fake messagebus on fake-uow. [fake_messagebus]
1 parent e29cdca commit 50b5e6b

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

tests/unit/test_handlers.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# pylint: disable=no-self-use
22
from datetime import date
33
from unittest import mock
4+
from typing import List
45
import pytest
56

67
from allocation.adapters import repository
@@ -126,3 +127,13 @@ def test_reallocates_if_necessary(self):
126127
assert batch1.available_quantity == 5
127128
# and 20 will be reallocated to the next batch
128129
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

Comments
 (0)