Beispiel #1
0
    def runTest(self):
        man = Manager(self.project,
                      self.release,
                      self.component,
                      self.language,
                      self.log)

        """ perform checkout """
        # perform build
        rev = man.build()

        # check if the file was added
        pofiles = POFile.objects.filter(component=self.component,
                                  release=self.release,
                                  language=self.language)
        
        # the repo should contain one file only
        self.assertEquals(pofiles.count(),1)
        
        """ perform commit """
        # modify the file
        f = open(pofiles[0].file,"a")
        f.write("test")
        f.close()
        
        # perform commit
        revc = man.commit(None, None, "test")
        self.assertEquals(revc, (rev + 1))
        
        # POT creation
        potman = POTUpdater(self.project, self.release, self.component,self.log)        
        potman.build()
        
        potfiles = POTFile.objects.filter(component=self.component)
        
        self.assertEquals(potfiles.count(),1)
        self.assertEquals(potfiles[0].total,5) # 5 messages
        self.assertEquals(potfiles[0].updated,'2009-09-21 09:47+0200')