-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
48 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,26 @@ | ||
import pytest | ||
|
||
from rabbit import Publish | ||
from rabbit.exceptions import ClientNotConnectedError | ||
|
||
|
||
async def test_send_event(publish_mock): | ||
await publish_mock.send_event(123) | ||
|
||
|
||
async def test_register_publish_without_client_connected(publish): | ||
def test_register_publish_without_client_connected(publish): | ||
with pytest.raises(ClientNotConnectedError): | ||
await publish.configure(True) | ||
hasattr(publish, "channel") | ||
|
||
|
||
def test_publish_repr(publish_mock): | ||
assert repr(publish_mock) == "Publish(channel_id=0, publisher_confirms=False)" | ||
|
||
|
||
async def test_enable_publish_confirms(publish_mock): | ||
assert publish_mock.publisher_confirms is False | ||
await publish_mock.enable_publish_confirms() | ||
assert publish_mock.publisher_confirms is True | ||
async def test_publish_confirms_disabled(publish): | ||
assert publish.publish_confirms is False | ||
|
||
|
||
async def test_enable_publish_confirms_twice(publish_mock): | ||
assert publish_mock.publisher_confirms is False | ||
await publish_mock.enable_publish_confirms() | ||
await publish_mock.enable_publish_confirms() | ||
assert publish_mock.publisher_confirms is True | ||
async def test_publish_confirms_enabled(): | ||
publish = Publish(True) | ||
assert publish.publish_confirms is True |