Skip to content

Commit

Permalink
Mock PublishClient instead of TCPPubClient
Browse files Browse the repository at this point in the history
  • Loading branch information
dwoz committed Dec 28, 2023
1 parent 449cca2 commit 5bc09e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/pytests/unit/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ def syndic_opts(tmp_path):

@pytest.fixture
def mocked_tcp_pub_client():
transport = MagicMock(spec=salt.transport.tcp.TCPPubClient)
transport = MagicMock(spec=salt.transport.tcp.PublishClient)
transport.connect = MagicMock()
future = asyncio.Future()
transport.connect.return_value = future
future.set_result(True)
with patch("salt.transport.tcp.TCPPubClient", transport):
with patch("salt.transport.tcp.PublishClient", transport):
yield

0 comments on commit 5bc09e5

Please sign in to comment.