示例#1
0
 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())
示例#2
0
    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())
示例#3
0
 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())
示例#4
0
 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())
示例#5
0
 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())