-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add missing `await` * Add test for service future creation
- Loading branch information
Showing
2 changed files
with
17 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import pytest | ||
from anycastd.core._run import run_services | ||
from anycastd.core._service import Service | ||
|
||
|
||
@pytest.fixture | ||
def mock_services(mocker): | ||
"""A set of mock services.""" | ||
return [mocker.AsyncMock(Service) for _ in range(3)] | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_future_created_for_each_service(mock_services): | ||
"""A future is created for each service.""" | ||
await run_services(mock_services) | ||
assert all(mock_service.run.called for mock_service in mock_services) |