GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — develop ( ad70c6...90d875 )
by Michael
01:06
created

tests.unit_tests.coro_mock()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
dl 0
loc 3
rs 10
1
from unittest import mock
2
3
import pytest
4
5
from server import GameStatsService, GameService, LadderService
6
from server.players import Player
7
from tests.utils import CoroMock
8
9
10
@pytest.fixture
11
def ladder_service(game_service: GameService, game_stats_service: GameStatsService):
12
    return LadderService(game_service, game_stats_service)
13
14
15
async def test_start_game(ladder_service: LadderService, game_service: GameService):
16
    p1 = mock.create_autospec(Player('Dostya', id=1))
17
    p2 = mock.create_autospec(Player('Rhiza', id=2))
18
    game_service.ladder_maps = [(1, 'scmp_007', 'maps/scmp_007.zip')]
19
20
    with mock.patch('asyncio.sleep', CoroMock()):
21
        await ladder_service.start_game(p1, p2)
22
23
    assert p1.lobby_connection.launch_game.called
24
    assert p2.lobby_connection.launch_game.called
25