def test_read(self): u = Universe() r = Reader(u) r.read('simple-project-1.fly') p1 = u.get_workpackage("project") self.assertEqual("project", p1.name) p2 = p1.get_node("sub2.bbb") self.assertEqual("bbb", p2.name) a = p2.activities[0] self.assertEqual(date(2012, 7, 14), a.day().date)
class CalcActivitiesByMonth(TestCase): def test_read(self): self.u = Universe() r = Reader(self.u) r.read('simple-project-2.fly') p1 = self.u.get_workpackage("project") self.assertEqual("project", p1.name) p2 = p1.get_node("sub2.bbb") self.assertEqual("bbb", p2.name) a = p2.activities[0] self.assertEqual(date(2012, 7, 12), a.day().date) a = p2.activities[1] self.assertEqual(date(2012, 7, 14), a.day().date) act = self.doStats(7) self.assertEqual(2.0, act.get_node('project.sub1.aa').value) self.assertEqual(3.0, act.get_node('project.sub3').value) self.assertEqual(10.0, act.get_node('project.sub2').value) act = self.doStats(8) self.assertEqual(1.5, act.get_node('project.sub1.aa').value) self.assertEqual(4.0, act.get_node('project.sub1').value) self.assertEqual(4.5, act.get_node('project.sub2').value) act = self.doStats(9) def doStats(self, month): ow = OutputWrapper('simple-project-2.out-' + str(month)) act = self.u.workpackage_root.calc_activity(MonthFilter(2012, month)) options = {'indent':' '} act.dump(options) self.assertTrue(ow.compare()) ow = OutputWrapper('simple-project-2.out-' + str(month) + '-act') options['activities'] = True act.dump(options) self.assertTrue(ow.compare()) return act
def test_read(self): self.u = Universe() r = Reader(self.u) r.read('simple-project-2.fly') p1 = self.u.get_workpackage("project") self.assertEqual("project", p1.name) p2 = p1.get_node("sub2.bbb") self.assertEqual("bbb", p2.name) a = p2.activities[0] self.assertEqual(date(2012, 7, 12), a.day().date) a = p2.activities[1] self.assertEqual(date(2012, 7, 14), a.day().date) act = self.doStats(7) self.assertEqual(2.0, act.get_node('project.sub1.aa').value) self.assertEqual(3.0, act.get_node('project.sub3').value) self.assertEqual(10.0, act.get_node('project.sub2').value) act = self.doStats(8) self.assertEqual(1.5, act.get_node('project.sub1.aa').value) self.assertEqual(4.0, act.get_node('project.sub1').value) self.assertEqual(4.5, act.get_node('project.sub2').value) act = self.doStats(9)