Changeset 57 for mergebot/trunk/utils
- Timestamp:
- Feb 23, 2010 8:23:29 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
mergebot/trunk/utils/test.py
r56 r57 102 102 raise Exception('svn ls failed with exit code %s' % retval) 103 103 104 def rebranch(self, ticket_id, component, timeout=15):104 def _rebranch(self, ticket_id, component, search, timeout=15): 105 105 """timeout is in seconds.""" 106 106 self.go_to_mergebot() … … 112 112 tc.find('CheckMerge') 113 113 self.go_to_ticket(ticket_id) 114 tc.find( '(Rebranched from .* for .*|There were conflicts on rebranching)')114 tc.find(search) 115 115 retval = call(['svn', 'ls', self.repo_url + '/' + component + '/branches/ticket-%s' % ticket_id], 116 116 stdout=logfile, stderr=logfile) 117 117 if retval: 118 118 raise Exception('svn ls failed with exit code %s' % retval) 119 120 def rebranch(self, ticket_id, component, timeout=15): 121 self._rebranch(ticket_id, component, 'Rebranched from .* for .*', timeout) 122 123 def rebranch_conflict(self, ticket_id, component, timeout=15): 124 self._rebranch(ticket_id, component, 'There were conflicts on rebranching', timeout) 119 125 120 126 def merge(self, ticket_id, component, timeout=5): … … 233 239 self.assertEqual(retval, 0, "svn commit failed with error %s" % (retval)) 234 240 241 def mv(self, oldname, newname): 242 retval = call(['svn', 'mv', oldname, newname], 243 cwd=self.get_workdir(), 244 stdout=logfile, stderr=logfile) 245 self.assertEqual(retval, 0, "svn mv failed with error %s" % (retval)) 246 235 247 236 248 class MergeBotTestEnabled(FunctionalTwillTestCaseSetup): … … 351 363 self.commit('Modify the file on branch') 352 364 353 self._tester.rebranch(ticket_id, 'stuff') 365 # rebranch, make sure it shows a conflict 366 self._tester.rebranch_conflict(ticket_id, 'stuff') 367 368 369 class MergeBotTestRebranchWithBranchRenameConflict(FunctionalSvnTestCaseSetup): 370 def runTest(self): 371 """Verify that the 'rebranch' button works when a file renamed on the branch was modified on trunk""" 372 ticket_id = self._tester.create_ticket(summary=self.__class__.__name__, 373 info={'component':'stuff', 'version':'trunk'}) 374 basename = self.__class__.__name__ 375 376 # create a file in which to have conflicts 377 self.checkout() 378 self.add_new_file(basename) 379 self.commit('Add a new file on trunk') 380 381 # create the branch 382 self._tester.branch(ticket_id, 'stuff') 383 384 # modify the file on trunk 385 open(os.path.join(self.get_workdir(), basename), 'a').write(random_sentence()) 386 self.commit('Modify the file on trunk') 387 388 # rename the file on the branch 389 self.switch(ticket_id) 390 self.mv(basename, basename + '-renamed') 391 self.commit('Rename the file on branch') 392 393 self._tester.rebranch_conflict(ticket_id, 'stuff') 354 394 355 395 … … 395 435 suite.addTest(MergeBotTestRebranchWithChangeAndTrunkChange()) 396 436 suite.addTest(MergeBotTestRebranchWithConflict()) 437 suite.addTest(MergeBotTestRebranchWithBranchRenameConflict()) 397 438 suite.addTest(MergeBotTestSingleUseCase()) 398 439 return suite
Note: See TracChangeset
for help on using the changeset viewer.