Changeset 46 for mergebot


Ignore:
Timestamp:
Feb 23, 2010 5:46:37 PM (15 years ago)
Author:
retracile
Message:

Mergebot: add a testcase

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mergebot/trunk/utils/test.py

    r45 r46  
    245245
    246246
     247class MergeBotTestRebranchWithChange(FunctionalTwillTestCaseSetup):
     248    def runTest(self):
     249        """Verify that the 'rebranch' button works with changes on the branch"""
     250        ticket_id = self._tester.create_ticket(summary=self.__class__.__name__,
     251            info={'component':'stuff', 'version':'trunk'})
     252        self._tester.branch(ticket_id, 'stuff')
     253
     254        # checkout a working copy & make a change
     255        svnurl = self._testenv.repo_url()
     256        workdir = os.path.join(self._testenv.dirname, self.__class__.__name__)
     257        retval = call(['svn', 'checkout', svnurl + '/stuff/branches/ticket-%s' % ticket_id, workdir],
     258            stdout=logfile, stderr=logfile)
     259        self.assertEqual(retval, 0, "svn checkout failed with error %s" % (retval))
     260        # Create & add a new file
     261        newfile = os.path.join(workdir, self.__class__.__name__)
     262        open(newfile, 'w').write(random_page())
     263        retval = call(['svn', 'add', self.__class__.__name__],
     264            cwd=workdir,
     265            stdout=logfile, stderr=logfile)
     266        self.assertEqual(retval, 0, "svn add failed with error %s" % (retval))
     267        retval = call(['svn', 'commit', '-m', 'Add a new file', self.__class__.__name__],
     268            cwd=workdir,
     269            stdout=logfile, stderr=logfile)
     270        self.assertEqual(retval, 0, "svn commit failed with error %s" % (retval))
     271
     272        self._tester.rebranch(ticket_id, 'stuff')
     273
     274
    247275class MergeBotTestSingleUseCase(FunctionalTwillTestCaseSetup):
    248276    def runTest(self):
     
    283311    suite.addTest(MergeBotTestCheckMerge())
    284312    suite.addTest(MergeBotTestMerge())
     313    suite.addTest(MergeBotTestRebranchWithChange())
    285314    suite.addTest(MergeBotTestSingleUseCase())
    286315    return suite
Note: See TracChangeset for help on using the changeset viewer.