[Cvsshell-devel] CVS: cvsshell/testing testcases.py,1.3,1.4
Status: Beta
Brought to you by:
stefanheimann
From: Stefan H. <ste...@us...> - 2002-08-15 21:42:19
|
Update of /cvsroot/cvsshell/cvsshell/testing In directory usw-pr-cvs1:/tmp/cvs-serv28124/testing Modified Files: testcases.py Log Message: last changes needed for release 0.3 Index: testcases.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/testing/testcases.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** testcases.py 7 Aug 2002 22:17:12 -0000 1.3 --- testcases.py 15 Aug 2002 21:42:17 -0000 1.4 *************** *** 143,146 **** --- 143,161 ---- self.assertPathEqual(workingDir, os.getcwd()) print 'end: testRecursiveRefreshWithoutArg' + + def testReplace1(self): + print 'start: testReplace1' + self.exe('refresh') + self.exe("commit -m 'not important' modified") + self.exe('replace 1.1 1') + self.assertEqual('you are the file modified', open('modified').read()) + self.exe('replace 20 modified') # should not throw an exception + + def testReplace2(self): + self.exe("commit -m 'not important' modified") + self.exe('replace 1.1 modified') + self.assertEqual('you are the file modified', open('modified').read()) + self.exe('replace 20 modified') # should not throw an exception + *************** *** 173,178 **** --- 188,201 ---- self.assert_(not os.path.exists(sdir)) + def testMultipleCommands(self): + self.assertEqual(None, self.cvsshell.listing) + self.exe("refresh ; echo 1 > dat1.txt; refresh; echo 2 > dat2.txt") + for file in ['dat1.txt', 'dat2.txt']: + self.assert_(os.path.exists(file)) + self.assert_(self.cvsshell.listing is not None) + if __name__ == '__main__': + rc = os.path.join(os.environ['HOME'], '.cvsshellrc') savedRC = os.path.join(os.environ['HOME'], '.cvsshellrc-saved') savedHistory = os.path.join(os.environ['HOME'], '.cvsshell_history-saved') *************** *** 180,200 **** try: os.rename(history, savedHistory) ! except: pass ! try: ! os.rename(os.path.join(os.environ['HOME'], '.cvsshellrc'), savedRC) ! restoreRC = 1 ! except: ! restoreRC = 0 ! try: ! unittest.main() ! except: ! pass try: ! os.unlink(history) ! os.rename(savedHistory, history) ! except: pass ! if restoreRC: ! try: ! os.rename(savedRC,os.path.join(os.environ['HOME'], '.cvsshellrc')) ! except OSError, msg: ! print 'could not restore config file:', msg --- 203,213 ---- try: os.rename(history, savedHistory) ! import atexit ! atexit.register(lambda : os.rename(savedHistory, history)) ! except OSError: pass try: ! os.rename(rc, savedRC) ! import atexit ! atexit.register(lambda : os.rename(savedRC, rc)) ! except OSError: pass ! unittest.main() |