예제 #1
0
 def test_ticket_is_task_like_if_it_has_remaining_time_field(self):
     self.teh.add_field_for_type(Key.REMAINING_TIME, Type.USER_STORY)
     story = AgiloTicket(self.env, t_type=Type.USER_STORY)
     self.assert_true(story.is_readable_field(Key.REMAINING_TIME))
     self.assert_true(story.is_task_like())
예제 #2
0
 def test_throws_exception_if_not_persisted_ticket_should_be_serialized(
         self):
     task = AgiloTicket(self.env, t_type=Type.TASK)
     self.assert_raises(ValueError, task.as_dict)
예제 #3
0
 def test_ticket_knows_if_it_is_task_like(self):
     task = AgiloTicket(self.env, t_type=Type.TASK)
     self.assert_true(task.is_readable_field(Key.REMAINING_TIME))
     self.assert_true(task.is_task_like())
예제 #4
0
 def test_ticket_knows_if_not_task_like(self):
     story = AgiloTicket(self.env, t_type=Type.USER_STORY)
     self.assert_false(story.is_readable_field(Key.REMAINING_TIME))
     self.assert_false(story.is_task_like())
예제 #5
0
 def test_strip_usernames_for_resource_list(self):
     task = AgiloTicket(self.env, t_type=Type.TASK)
     task[Key.RESOURCES] = '  foo, bar,baz  '
     self.assert_equals(['foo', 'bar', 'baz'], task.get_resource_list())
예제 #6
0
 def test_owner_is_only_listed_once_in_resource_list(self):
     story = AgiloTicket(self.env, t_type=Type.USER_STORY)
     story[Key.OWNER] = 'Foo Bar'
     story[Key.RESOURCES] = 'Foo Bar'
     self.assert_equals(['Foo Bar'],
                        story.get_resource_list(include_owner=True))
예제 #7
0
 def test_resource_list_with_owner_and_resources(self):
     story = AgiloTicket(self.env, t_type=Type.USER_STORY)
     story[Key.OWNER] = 'Foo'
     story[Key.RESOURCES] = 'Bar, Baz'
     self.assert_equals(['Foo', 'Bar', 'Baz'],
                        story.get_resource_list(include_owner=True))
예제 #8
0
 def test_resource_list_when_no_resource_field_present(self):
     story = AgiloTicket(self.env, t_type=Type.USER_STORY)
     self.assert_equals('', story[Key.RESOURCES])
     self.assert_equals(0, len(story.get_resource_list()))
예제 #9
0
 def test_story_has_total_remaining_time_and_estimated_remaining_time_by_default(
         self):
     story = AgiloTicket(self.env, t_type=Type.USER_STORY)
     self.assert_equals(
         [Key.TOTAL_REMAINING_TIME, Key.ESTIMATED_REMAINING_TIME],
         story.get_calculated_fields_names())