Ejemplo n.º 1
0
 def test_unpackSvn(self):
     if not svn.isSvnInstalled():
         self.fail(
             "Svn is not installed on your system.  All Svn tests will fail."
         )
     try:
         tempDir = mdTestUtilities.makeTempDir()
         repoPath = mdTestUtilities.createSvnRepository(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,
                          "Svn repository failed to fetch.")
         self.assertEqual(
             os.path.exists(testFilePath), True,
             "'" + mdTestUtilities.testFileName +
             "' did not exist after fetching a Svn repository.")
         pci = steps.unpack(pci)
         self.assertEqual(pci.success, True,
                          "Svn repository failed to unpack.")
         self.assertEqual(
             os.path.isdir(pci.currentPath), True,
             "Svn 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)
Ejemplo n.º 2
0
 def test_svnCheckout(self):
     if not svn.isSvnInstalled():
         self.fail("Svn is not installed on your system.  All Svn tests will fail.")
     try:
         tempDir = mdTestUtilities.makeTempDir()
         tempRepo = mdTestUtilities.createSvnRepository(tempDir)
         checkedOutRepo = os.path.join(tempDir, "checkedOut")
         svn.svnCheckout(tempRepo, checkedOutRepo)
         returnValue = os.path.exists(os.path.join(checkedOutRepo, mdTestUtilities.testFileName))
         self.assertEqual(returnValue, True, "'" + mdTestUtilities.testFileName + "' did not exist after svn.svnCheckout(" + tempRepo + ") was called.")
     finally:
         utilityFunctions.removeDir(tempDir)
Ejemplo n.º 3
0
 def test_fetchSvn(self):
     if not svn.isSvnInstalled():
         self.fail("Svn is not installed on your system.  All Svn tests will fail.")
     try:
         tempDir = mdTestUtilities.makeTempDir()
         repoPath = mdTestUtilities.createSvnRepository(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, "Svn repository failed to fetch.")
         self.assertEqual(os.path.exists(testFilePath), True, "'" + mdTestUtilities.testFileName + "' did not exist after fetching a Svn repository.")
     finally:
         utilityFunctions.removeDir(tempDir)
Ejemplo n.º 4
0
 def test_isSvnRepo(self):
     if not svn.isSvnInstalled():
         self.fail("Svn is not installed on your system.  All Svn tests will fail.")
     #Create repository and test if is svn repo
     try:
         tempDir = mdTestUtilities.makeTempDir()
         tempRepo = mdTestUtilities.createSvnRepository(tempDir)
         returnValue = svn.isSvnRepo(tempRepo)
         self.assertEqual(returnValue, True, "svn.isSvnRepo(" + tempRepo + ") should have returned true.")
     finally:
         utilityFunctions.removeDir(tempDir)
     #Test if wrong path returns false
     falsePath = "http://foo/wrong/path"
     returnValue = svn.isSvnRepo(falsePath)
     self.assertEqual(returnValue, False, "svn.isSvnRepo(" + falsePath + ") should have returned false.")
Ejemplo n.º 5
0
 def test_svnCheckout(self):
     if not svn.isSvnInstalled():
         self.fail(
             "Svn is not installed on your system.  All Svn tests will fail."
         )
     try:
         tempDir = mdTestUtilities.makeTempDir()
         tempRepo = mdTestUtilities.createSvnRepository(tempDir)
         checkedOutRepo = os.path.join(tempDir, "checkedOut")
         svn.svnCheckout(tempRepo, checkedOutRepo)
         returnValue = os.path.exists(
             os.path.join(checkedOutRepo, mdTestUtilities.testFileName))
         self.assertEqual(
             returnValue, True, "'" + mdTestUtilities.testFileName +
             "' did not exist after svn.svnCheckout(" + tempRepo +
             ") was called.")
     finally:
         utilityFunctions.removeDir(tempDir)
Ejemplo n.º 6
0
 def test_isSvnRepo(self):
     if not svn.isSvnInstalled():
         self.fail(
             "Svn is not installed on your system.  All Svn tests will fail."
         )
     #Create repository and test if is svn repo
     try:
         tempDir = mdTestUtilities.makeTempDir()
         tempRepo = mdTestUtilities.createSvnRepository(tempDir)
         returnValue = svn.isSvnRepo(tempRepo)
         self.assertEqual(
             returnValue, True,
             "svn.isSvnRepo(" + tempRepo + ") should have returned true.")
     finally:
         utilityFunctions.removeDir(tempDir)
     #Test if wrong path returns false
     falsePath = "http://foo/wrong/path"
     returnValue = svn.isSvnRepo(falsePath)
     self.assertEqual(
         returnValue, False,
         "svn.isSvnRepo(" + falsePath + ") should have returned false.")