def test_list_logs_content(self): """ Tests that logs list initial content is empty """ control_agent = ListLogsControlAgent() presentation_agent = control_agent.get_presentation_agent() model = presentation_agent["logs_list"].get_model() refresh_gui() self.assertEquals(len(model), 0)
def test_list_logs_clear(self): """ Tests that a command executed notification adds the command to logs list """ control_agent = ListLogsControlAgent() presentation_agent = control_agent.get_presentation_agent() model = presentation_agent["logs_list"].get_model() command = TestCommand() command.register_command_observer(control_agent) command.notify_command_executed() presentation_agent["clearlogs"].activate() refresh_gui() self.assertEquals(len(model), 0)
def test_list_logs_command_execution(self): """ Tests that a command executed notification adds the command to logs list """ control_agent = ListLogsControlAgent() presentation_agent = control_agent.get_presentation_agent() model = presentation_agent["logs_list"].get_model() command = TestCommand() command.add_callback(control_agent) command.notify_command_executed() refresh_gui() self.assertEquals(len(model), 1) modrow = model[0] self.assertTrue(modrow[3] is command)