File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77from allocation .adapters import notifications
88from allocation .service_layer import messagebus , unit_of_work
99
10- email_config = config .get_email_host_and_port ()
10+ cfg = config .get_email_host_and_port ()
1111
1212@pytest .fixture
1313def bus (sqlite_session_factory ):
1414 uow = unit_of_work .SqlAlchemyUnitOfWork (sqlite_session_factory )
1515 bus = messagebus .MessageBus (
1616 uow = uow ,
1717 notifications = notifications .EmailNotifications (
18- smtp_host = email_config ['host' ],
19- port = email_config ['port' ],
18+ smtp_host = cfg ['host' ],
19+ port = cfg ['port' ],
2020 ),
2121 publish = lambda * _ , ** __ : None
2222 )
@@ -33,7 +33,7 @@ def test_out_of_stock_email(bus):
3333 bus .handle (commands .CreateBatch ('batch1' , sku , 9 , None ))
3434 bus .handle (commands .Allocate ('order1' , sku , 10 ))
3535 messages = requests .get (
36- f'http://{ email_config ["host" ]} :{ email_config ["http_port" ]} /api/v2/messages'
36+ f'http://{ cfg ["host" ]} :{ cfg ["http_port" ]} /api/v2/messages'
3737 ).json ()
3838 message = next (
3939 m for m in messages ['items' ]
You can’t perform that action at this time.
0 commit comments