mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix test when using context manager is used
This commit is contained in:
parent
6615b5a530
commit
6e5a301ca6
1 changed files with 3 additions and 1 deletions
|
@ -17,7 +17,9 @@ async def test_async_pub_channel_connect_cb(minion_opts):
|
|||
channel._reconnected = True
|
||||
|
||||
mock = MagicMock(salt.channel.client.AsyncReqChannel)
|
||||
mock.__enter__ = lambda self: mock
|
||||
|
||||
with patch("salt.channel.client.AsyncReqChannel.factory", return_value=mock):
|
||||
await channel.connect_callback(None)
|
||||
mock.send.assert_called_once()
|
||||
mock.close.assert_called_once()
|
||||
mock.__exit__.assert_called_once()
|
||||
|
|
Loading…
Add table
Reference in a new issue