-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1853 from TimoGlastra/fix/return-processing-no-re…
…sponse fix: return if return route but no response
- Loading branch information
Showing
5 changed files
with
52 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import asyncio | ||
|
||
from asynctest import TestCase | ||
|
||
from ..message import InboundMessage | ||
from ..receipt import MessageReceipt | ||
|
||
|
||
class TestInboundMessage(TestCase): | ||
async def test_wait_response(self): | ||
message = InboundMessage( | ||
payload="test", | ||
connection_id="conn_id", | ||
receipt=MessageReceipt(), | ||
session_id="session_id", | ||
) | ||
assert not message.processing_complete_event.is_set() | ||
message.dispatch_processing_complete() | ||
assert message.processing_complete_event.is_set() | ||
|
||
message = InboundMessage( | ||
payload="test", | ||
connection_id="conn_id", | ||
receipt=MessageReceipt(), | ||
session_id="session_id", | ||
) | ||
assert not message.processing_complete_event.is_set() | ||
task = message.wait_processing_complete() | ||
message.dispatch_processing_complete() | ||
await asyncio.wait_for(task, 1) |