def test_get_game_info_in_countdown(): mock_game = mock(spec=minqlx.Game, strict=False) mock_game.state = "countdown" game_info = mydiscordbot.get_game_info(mock_game) assert_that(game_info, is_("Match starting"))
def test_get_game_info_in_warmup(): mock_game = mock(spec=minqlx.Game, strict=False) mock_game.state = "warmup" game_info = mydiscordbot.get_game_info(mock_game) assert_that(game_info, is_("Warmup"))
def test_get_game_info_unknown_game_state(): mock_game = mock(spec=minqlx.Game, strict=False) mock_game.state = "asdf" mock_game.roundlimit = 8 mock_game.red_score = 3 mock_game.blue_score = 2 game_info = mydiscordbot.get_game_info(mock_game) assert_that(game_info, is_("Warmup"))
def test_get_game_info_blue_player_dropped_out(): mock_game = mock(spec=minqlx.Game, strict=False) mock_game.state = "in_progress" mock_game.roundlimit = 8 mock_game.red_score = 5 mock_game.blue_score = -999 game_info = mydiscordbot.get_game_info(mock_game) assert_that(game_info, is_("Match ended: **5** - **-999**"))
def test_get_game_info_red_hit_roundlimit(): mock_game = mock(spec=minqlx.Game, strict=False) mock_game.state = "in_progress" mock_game.roundlimit = 8 mock_game.red_score = 8 mock_game.blue_score = 2 game_info = mydiscordbot.get_game_info(mock_game) assert_that(game_info, is_("Match ended: **8** - **2**"))