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", )
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", )
def test_time_to_string_wrong_value(value: Any, expected: Exception): with pytest.raises(expected): time_to_string(value)
def test_time_to_string_ok(time: int, expected: str): assert time_to_string(time) == expected