def close_sprint(self): self._tester.login_as(Usernames.scrum_master) env = self._testenv.get_trac_environment() teh = TestEnvHelper(env=env, env_key=self.env_key) team = teh.create_team('A-Team') tm = teh.create_member(name="TeamMember", team=team) self._create_sprint('TestSprintClose', team=team.name) self._create_sprint('TestSprintClose2', team=team.name) # create a ticket ticket = teh.create_ticket(Type.TASK, props={Key.SPRINT: 'TestSprintClose', Key.OWNER: tm.name}) self.assertEqual(ticket[Key.SPRINT], 'TestSprintClose') def _close_sprint(name, retarget=None): page_url = '%s/%s' % (SPRINT_URL, name) confirm_url = '%s/%s/confirm' % (SPRINT_URL, name) tc.go(page_url) tc.fv('confirmform', 'close', 'click') tc.submit() # show confirmation form tc.url(confirm_url) if retarget is not None: # should show that one ticket can be retargeted tc.find('Retarget the \d+ remaining tickets to sprint') tc.fv('confirmform', 'retarget', retarget) tc.fv('confirmform', 'sure', 'click') tc.submit('sure') # we're back at the roadmap tc.url('/roadmap') # Closes Testsprint with retarget to Testsprint2 _close_sprint('TestSprintClose', 'TestSprintClose2') # and the ticket now has a new sprint ticket = teh.load_ticket(ticket=ticket) self.assertEqual(ticket[Key.SPRINT], 'TestSprintClose2') # Check that retargeted ticket show who did the retargeting self._tester.go_to_view_ticket_page(ticket.id) tc.notfind('ago.* by anonymous') tc.find('ago.* by %s' % Usernames.scrum_master) # Delete Testsprint with retarget to Testsprint2 _close_sprint('TestSprintClose2')
def test_agilo_with_parallel_environments(self): """ Tests agilo in parallel with two different environment, one with and one without agilo """ ac_agilo = AgiloConfig(self.env) ac_agilo.enable_agilo() env_no_agilo = TestEnvHelper(env_key=self.env_key) ac_no_agilo = AgiloConfig(env_no_agilo.get_env()) ac_no_agilo.disable_agilo() # Now we have two environment in the same python VM agilo_ticket = self.teh.create_ticket(Type.TASK, props={Key.REMAINING_TIME: '2'}) self.assert_true(isinstance(agilo_ticket, AgiloTicket), "Got the wrong type: %s" % type(agilo_ticket)) non_agilo_ticket = env_no_agilo.create_ticket( Type.TASK, props={Key.REMAINING_TIME: '2'}) self.assert_true(hasattr(agilo_ticket, '_calculated')) self.assert_false(hasattr(non_agilo_ticket, '_calculated'))
def test_agilo_with_parallel_environments(self): """ Tests agilo in parallel with two different environment, one with and one without agilo """ ac_agilo = AgiloConfig(self.env) ac_agilo.enable_agilo() env_no_agilo = TestEnvHelper(env_key=self.env_key) ac_no_agilo = AgiloConfig(env_no_agilo.get_env()) ac_no_agilo.disable_agilo() # Now we have two environment in the same python VM agilo_ticket = self.teh.create_ticket(Type.TASK, props={Key.REMAINING_TIME: '2'}) self.assert_true(isinstance(agilo_ticket, AgiloTicket), "Got the wrong type: %s" % type(agilo_ticket)) non_agilo_ticket = env_no_agilo.create_ticket(Type.TASK, props={Key.REMAINING_TIME: '2'}) self.assert_true(hasattr(agilo_ticket, '_calculated')) self.assert_false(hasattr(non_agilo_ticket, '_calculated'))