def test_executions__day_executions__multiple_clients__first_client_with_last_day_empty(self): a_project = Project('project name') a_client = Client('a_client') a_client2 = Client('a_client2') listener1 = ServerListener( client=a_client, project=a_project ) listener1.current_time = lambda : "2006-04-29-12-12-00" listener2 = ServerListener( client=a_client2, project=a_project ) listener2.current_time = lambda : "2006-04-29-12-00-00" generator = WebGenerator(project_name= a_project.name) task = Task(a_project, a_client, 'task') task.add_subtask('subtask1', []) Runner(task, testinglisteners=[listener1]) task = Task(a_project, a_client2, 'task') task.add_subtask('subtask1', []) Runner(task, testinglisteners=[listener2]) listener2.current_time = lambda : "2006-04-30-12-00-00" Runner(task, testinglisteners=[listener2]) self.assertEquals( {'2006-04-30': {'a_client2': [('2006-04-30-12-00-00', '2006-04-30-12-00-00', 'task', 'stable')]}, '2006-04-29': {'a_client2': [('2006-04-29-12-00-00', '2006-04-29-12-00-00', 'task', 'stable')], 'a_client': [('2006-04-29-12-12-00', '2006-04-29-12-12-00', 'task', 'stable')] } }, generator.day_executions(generator.get_executions()) )
def test_executions__day_executions__single_client(self): a_project = Project('project name') listener = ServerListener( project = a_project) listener.current_time = lambda : "2006-04-29-12-00-00" a_project = Project('project name') generator = WebGenerator(project_name= a_project.name) a_client = Client('client name') task = Task(a_project, a_client, 'task') task.add_subtask('subtask1', []) Runner(task, testinglisteners=[listener]) listener.current_time = lambda : "2006-04-30-12-00-00" Runner(task, testinglisteners=[listener]) self.assertEquals( {'2006-04-30': {'testing_client': [('2006-04-30-12-00-00', '2006-04-30-12-00-00', 'task', 'stable')]}, '2006-04-29': {'testing_client': [('2006-04-29-12-00-00', '2006-04-29-12-00-00', 'task', 'stable')]} }, generator.day_executions(generator.get_executions()) )