-
Notifications
You must be signed in to change notification settings - Fork 515
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 #666 from sklump/unit-tests-more-transport
cover more transport code
- Loading branch information
Showing
3 changed files
with
200 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from asynctest import TestCase as AsyncTestCase, mock as async_mock | ||
|
||
from ...config.injection_context import InjectionContext | ||
|
||
from .. import stats as test_module | ||
|
||
|
||
class TestStatsTracer(AsyncTestCase): | ||
def setUp(self): | ||
self.context = async_mock.MagicMock( | ||
socket_timer=async_mock.MagicMock( | ||
stop=async_mock.MagicMock(side_effect=AttributeError("wrong")) | ||
) | ||
) | ||
self.tracer = test_module.StatsTracer(test_module.Collector(), "test") | ||
|
||
async def test_queued_start_stop(self): | ||
await self.tracer.connection_queued_start(None, self.context, None) | ||
await self.tracer.connection_queued_end(None, self.context, None) | ||
|
||
async def test_connection_ready_error_pass(self): | ||
await self.tracer.connection_ready(None, self.context, None) |