def testSetDescription(self): story = pytracker.Story() story.SetDescription('day after day the sun') self.assertEquals('day after day the sun', story.GetDescription()) story.SetDescription('') self.assertEquals('', story.GetDescription()) self.assertEquals( '<?xml version="1.0" encoding="utf-8"?><story><description></description></story>', story.ToXml())
def testNewStory(self): s = pytracker.Story() self.assertEquals(self.EMPTY_STORY, s.ToXml()) s.AddLabel('red') self.assertEquals( """<?xml version="1.0" encoding="utf-8"?><story>""" """<labels>red</labels></story>""", s.ToXml()) s.AddLabel('green') self.assertEquals( """<?xml version="1.0" encoding="utf-8"?><story>""" """<labels>green,red</labels></story>""", s.ToXml()) s.SetEstimate(3) self.assertEquals( """<?xml version="1.0" encoding="utf-8"?><story>""" """<estimate>3</estimate><labels>green,red</labels></story>""", s.ToXml())
def testSetCreatedAt(self): story = pytracker.Story() story.SetCreatedAt(1290153802.0) self.assertEquals( '<?xml version="1.0" encoding="utf-8"?><story><created_at type="datetime">2010/11/19 08:03:22 UTC</created_at></story>', story.ToXml())
def testSetDeadline(self): story = pytracker.Story() story.SetDeadline(1290153802.0) self.assertEquals( '<?xml version="1.0" encoding="utf-8"?><story><deadline type="datetime">2010/11/19 08:03:22 UTC</deadline></story>', story.ToXml())
def testSetReportedBy(self): story = pytracker.Story() story.SetRequestedBy('dcoker') self.assertEquals( '<?xml version="1.0" encoding="utf-8"?><story><requested_by>dcoker</requested_by></story>', story.ToXml())