Esempio n. 1
0
    def test_plays_sound_when_round_still_running(self):
        warner_thread_name = "test_plays_sound_when_round_still_running1"
        setup_game_in_progress(game_type="ca")
        self.warner.warner_thread_name = warner_thread_name

        undecorated(self.warner.play_thirty_second_warning)(self.warner,
                                                            warner_thread_name)

        assert_plugin_played_sound(any_(str))
Esempio n. 2
0
    def test_plays_no_sound_when_next_round_started(self):
        calling_round_number = 4
        setup_game_in_progress(game_type="ca")
        self.warner.timer_round_number = calling_round_number + 1

        undecorated(self.warner.play_thirty_second_warning)(
            self.warner, calling_round_number)

        assert_plugin_played_sound(any_(str), times=0)
    def test_warning_blink(self):
        spy2(time.sleep)
        when2(time.sleep, any_(float)).thenReturn(None)

        autoready.warning_blink(30, "thirty_second_warning")

        verify(time).sleep(0.4)
        assert_plugin_played_sound("thirty_second_warning")
        assert_plugin_center_printed(
            "Match will ^2auto-start^7 in\n^1 ^7:^1  ")
        assert_plugin_center_printed(
            "Match will ^2auto-start^7 in\n^10^7:^130")
    def test_wear_off_double_blink(self):
        spy2(time.sleep)
        when2(time.sleep, any_(float)).thenReturn(None)

        autoready.wear_off_double_blink(8)

        verify(time, times=2).sleep(0.2)
        verify(time).sleep(0.3)
        assert_plugin_played_sound("sound/items/wearoff.ogg")
        assert_plugin_center_printed(
            "Match will ^2auto-start^7 in\n^1 ^7:^1  ", times=2)
        assert_plugin_center_printed(
            "Match will ^2auto-start^7 in\n^10^7:^108", times=2)
Esempio n. 5
0
    def test_plays_no_sound_when_game_not_in_progress(self):
        setup_game_in_warmup()

        undecorated(self.warner.play_thirty_second_warning)(self.warner, 4)

        assert_plugin_played_sound(any_(str), times=0)
Esempio n. 6
0
    def test_plays_no_sound_when_game_is_not_clan_arena(self):
        setup_game_in_progress(game_type="ft")

        undecorated(self.warner.play_thirty_second_warning)(self.warner, 4)

        assert_plugin_played_sound(any_(str), times=0)
Esempio n. 7
0
    def test_plays_no_sound_when_game_is_not_running_anymore(self):
        setup_no_game()

        undecorated(self.warner.play_thirty_second_warning)(self.warner, 4)

        assert_plugin_played_sound(any_(str), times=0)