예제 #1
0
    def draw_time(self, time: int):
        """Visualize (draw) the current match time

        Args:
            time (int): the current match time
        """
        self.setLabel(
            LabelIDs.TIME.value,
            time_to_string(time),
            0.45,
            0.01,
            0.1,
            0x000000,
            0.0,
            "Arial",
        )
예제 #2
0
    def draw_event_messages(self):
        """Visualize (draw) the event messages from queue"""
        messages = []
        for time, msg in self.event_messages_to_draw:
            messages.append("{} - {}".format(time_to_string(time), msg))

        if messages:
            self.setLabel(
                LabelIDs.EVENT_MESSAGES.value,
                "\n".join(messages),
                0.01,
                0.95 - ((len(messages) - 1) * 0.025),
                0.05,
                0xffffff,
                0.0,
                "Tahoma",
            )
예제 #3
0
def test_time_to_string_wrong_value(value: Any, expected: Exception):
    with pytest.raises(expected):
        time_to_string(value)
예제 #4
0
def test_time_to_string_ok(time: int, expected: str):
    assert time_to_string(time) == expected