def testMainWithCheckout(self): self.setUpProject("mainWithCheckout") scmWork = self.scmWork testScunchWithCheckoutPath = self.createTestFolder("testMainWithCheckout") scmWork.exportTo(testScunchWithCheckoutPath, clear=True) self.assertTrue(os.path.exists(scmWork.localTargetPath)) self._testMain(["--before", "checkout", "--depot", self.scmDepotTrunkQualifier, testScunchWithCheckoutPath, scmWork.localTargetPath]) self.assertTrue(os.path.exists(scmWork.localTargetPath)) _tools.removeFolder(scmWork.localTargetPath) self.assertFalse(os.path.exists(scmWork.localTargetPath)) self._testMain(["--before", "checkout", "--depot", self.scmDepotTrunkQualifier, testScunchWithCheckoutPath, scmWork.localTargetPath]) self.assertTrue(os.path.exists(scmWork.localTargetPath))
def testPunchWithRemove(self): self.setUpProject("punchWithRemove") scmWork = self.scmWork testPunchWithRemovePath = self.createTestFolder("testPunchWithRemove") scmWork.exportTo(testPunchWithRemovePath, clear=True) readMeTxtPath = os.path.join(testPunchWithRemovePath, "ReadMe.txt") os.remove(readMeTxtPath) whilePyPath = os.path.join(testPunchWithRemovePath, "loops", "while.py") os.remove(whilePyPath) mediaPath = os.path.join(testPunchWithRemovePath, "media") _tools.removeFolder(mediaPath) addingPuncher = scunch.ScmPuncher(scmWork) addingPuncher.punch(testPunchWithRemovePath) self.assertNonNormalStatus({scunch.ScmStatus.Removed: 3}) self._testAfterPunch(testPunchWithRemovePath)
def testCanMessWithFolders(self): testFolderPath = tempfile.mkdtemp(prefix="scunch_test_") _tools.removeFolder(testFolderPath) self.assertFalse(os.path.exists(testFolderPath)) _tools.makeFolder(testFolderPath) self.assertTrue(os.path.exists(testFolderPath)) _tools.makeFolder(testFolderPath) _tools.removeFolder(testFolderPath) _tools.makeEmptyFolder(testFolderPath) _tools.makeEmptyFolder(testFolderPath) # Clean up. _tools.removeFolder(testFolderPath)