示例#1
0
 def test_add(self):
     """L{Roadmap.add} adds a L{TimePeriod} to a roadmap."""
     roadmap = Roadmap("project-name")
     start_date = datetime.utcnow()
     end_date = start_date + timedelta(days=30)
     time_period = TimePeriod("name", start_date, end_date)
     roadmap.add(time_period)
     self.assertEqual([time_period], roadmap.time_periods)
示例#2
0
 def test_tracks(self):
     """
     The tracks exposed with the L{Roadmap.tracks} property are sorted by
     name.
     """
     roadmap = Roadmap("project-name")
     start_date = datetime.utcnow()
     end_date = start_date + timedelta(days=30)
     time_period1 = TimePeriod("name1", start_date, end_date)
     time_period1.add(Story("name1", "description", "track1", QUEUED))
     time_period1.add(Story("name2", "description", "track2", QUEUED))
     time_period2 = TimePeriod("name2", start_date, end_date)
     time_period2.add(Story("name3", "description", "track3", QUEUED))
     roadmap.add(time_period1)
     roadmap.add(time_period2)
     self.assertEqual(["track1", "track2", "track3"],
                      roadmap.tracks)