예제 #1
0
 def _test_unpackCvs(self):
     if not mdCvs.isCvsInstalled():
         self.fail(
             "Cvs is not installed on your system.  All Cvs tests will fail."
         )
     try:
         tempDir = mdTestUtilities.makeTempDir()
         repoPath = mdTestUtilities.createCvsRepository(tempDir)
         pci = createPythonCallInfo(repoPath,
                                    os.path.join(tempDir, "output"),
                                    os.path.join(tempDir, "download"))
         pci = steps.fetch(pci)
         testFilePath = os.path.join(pci.outputPath,
                                     mdTestUtilities.testFileName)
         self.assertEqual(pci.success, True,
                          "Cvs repository failed to fetch.")
         self.assertEqual(
             os.path.exists(testFilePath), True,
             "'" + mdTestUtilities.testFileName +
             "' did not exist after fetching a Cvs repository.")
         pci = steps.unpack(pci)
         self.assertEqual(pci.success, True,
                          "Cvs repository failed to unpack.")
         self.assertEqual(
             os.path.isdir(pci.currentPath), True,
             "Cvs repository was not a directory after unpacking.")
         self.assertEqual(
             os.path.exists(
                 os.path.join(pci.currentPath,
                              mdTestUtilities.testFileName)), True,
             "testFile did not exist after unpacking.")
     finally:
         utilityFunctions.removeDir(tempDir)
예제 #2
0
 def test_cvsCheckout(self):
     if not cvs.isCvsInstalled():
         self.fail("Cvs is not installed on your system.  All Cvs tests will fail.")
     tempDir = mdTestUtilities.makeTempDir()
     tempRepo = mdTestUtilities.createCvsRepository(tempDir)
     checkedOutRepo = os.path.join(tempDir, "checkedOut")
     try:
         cvs.cvsCheckout(tempRepo, checkedOutRepo)
         returnValue = os.path.exists(os.path.join(checkedOutRepo, mdTestUtilities.testFileName))
         self.assertEqual(returnValue, True, "'" + mdTestUtilities.testFileName + "' did not exist after cvs.cvsCheckout(" + tempRepo + ") was called.")
     finally:
         utilityFunctions.removeDir(tempDir)
예제 #3
0
 def _test_fetchCvs(self):
     if not mdCvs.isCvsInstalled():
         self.fail("Cvs is not installed on your system.  All Cvs tests will fail.")
     try:
         tempDir = mdTestUtilities.makeTempDir()
         repoPath = mdTestUtilities.createCvsRepository(tempDir)
         pci = createPythonCallInfo(repoPath, os.path.join(tempDir, "output"), os.path.join(tempDir, "download"))
         pci = steps.fetch(pci)
         testFilePath = os.path.join(pci.outputPath, mdTestUtilities.testFileName)
         self.assertEqual(pci.success, True, "Cvs repository failed to fetch.")
         self.assertEqual(os.path.exists(testFilePath), True, "'" + mdTestUtilities.testFileName + "' did not exist after fetching a Cvs repository.")
     finally:
         utilityFunctions.removeDir(tempDir)
예제 #4
0
 def test_isCvsRepo(self):
     if not cvs.isCvsInstalled():
         self.fail("Cvs is not installed on your system.  All Cvs tests will fail.")
     #Create repository and test if is cvs repo
     tempDir = mdTestUtilities.makeTempDir()
     tempRepo = mdTestUtilities.createCvsRepository(tempDir)
     try:
         returnValue = cvs.isCvsRepo(tempRepo)
         self.assertEqual(returnValue, True, "cvs.isCvsRepo(" + tempRepo + ") should have returned true.")
     finally:
         utilityFunctions.removeDir(tempDir)
     #Test if wrong path returns false
     falsePath = "http://foo/wrong/path"
     returnValue = cvs.isCvsRepo(falsePath)
     self.assertEqual(returnValue, False, "cvs.isCvsRepo(" + falsePath + ") should have returned false.")
예제 #5
0
 def test_isCvsRepo(self):
     if not cvs.isCvsInstalled():
         self.fail("Cvs is not installed on your system.  All Cvs tests will fail.")
     # Create repository and test if is cvs repo
     tempDir = mdTestUtilities.makeTempDir()
     tempRepo = mdTestUtilities.createCvsRepository(tempDir)
     try:
         returnValue = cvs.isCvsRepo(tempRepo)
         self.assertEqual(returnValue, True, "cvs.isCvsRepo(" + tempRepo + ") should have returned true.")
     finally:
         utilityFunctions.removeDir(tempDir)
     # Test if wrong path returns false
     falsePath = "http://foo/wrong/path"
     returnValue = cvs.isCvsRepo(falsePath)
     self.assertEqual(returnValue, False, "cvs.isCvsRepo(" + falsePath + ") should have returned false.")
예제 #6
0
 def test_cvsCheckout(self):
     if not cvs.isCvsInstalled():
         self.fail("Cvs is not installed on your system.  All Cvs tests will fail.")
     tempDir = mdTestUtilities.makeTempDir()
     tempRepo = mdTestUtilities.createCvsRepository(tempDir)
     checkedOutRepo = os.path.join(tempDir, "checkedOut")
     try:
         cvs.cvsCheckout(tempRepo, checkedOutRepo)
         returnValue = os.path.exists(os.path.join(checkedOutRepo, mdTestUtilities.testFileName))
         self.assertEqual(
             returnValue,
             True,
             "'"
             + mdTestUtilities.testFileName
             + "' did not exist after cvs.cvsCheckout("
             + tempRepo
             + ") was called.",
         )
     finally:
         utilityFunctions.removeDir(tempDir)