Example #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)
Example #2
0
 def test_unpackZip(self):
     try:
         tempDir = mdTestUtilities.makeTempDir()
         zipDir, zipName = mdTestUtilities.createZipFile(tempDir)
         zipPath = os.path.join(tempDir, zipName)
         pci = createPythonCallInfo(zipPath,
                                    os.path.join(tempDir, "output"),
                                    os.path.join(tempDir, "download"))
         pci = steps.fetch(pci)
         self.assertEqual(pci.success, True,
                          "Local Zip file failed to fetch.")
         self.assertEqual(os.path.exists(pci.currentPath), True,
                          "Zip file did not exist after fetching.")
         self.assertEqual(zipfile.is_zipfile(pci.currentPath), True,
                          "Zip file was not a tar file after fetching.")
         pci = steps.unpack(pci)
         self.assertEqual(pci.success, True, "Zip file failed to unpack.")
         self.assertEqual(os.path.isdir(pci.currentPath), True,
                          "Zip file 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)
Example #3
0
 def test_fetchTar(self):
     try:
         tempDir = mdTestUtilities.makeTempDir()
         tarDir, tarName = mdTestUtilities.createTarFile(tempDir)
         tarPath = os.path.join(tempDir, tarName)
         pci = createPythonCallInfo(tarPath, os.path.join(tempDir, "output"), os.path.join(tempDir, "download"))
         pci = steps.fetch(pci)
         self.assertEqual(pci.success, True, "Local tar file failed to fetch.")
         self.assertEqual(os.path.exists(pci.currentPath), True, "Tar file did not exist after fetching.")
         self.assertEqual(tarfile.is_tarfile(pci.currentPath), True, "Tar file was not a tar file after fetching.")
     finally:
         utilityFunctions.removeDir(tempDir)
Example #4
0
 def test_fetchURL(self):
     try:
         tempDir = mdTestUtilities.makeTempDir()
         tarDir, tarName = mdTestUtilities.createGzipFile(tempDir)
         urlPath = "http://ftp.gnu.org/gnu/autoconf/autoconf-2.68.tar.gz"
         pci = createPythonCallInfo(urlPath, os.path.join(tempDir, "output"), os.path.join(tempDir, "download"))
         pci = steps.fetch(pci)
         self.assertEqual(pci.success, True, "Gzip file failed to fetch from URL.")
         self.assertEqual(os.path.exists(pci.currentPath), True, "Gzip file did not exist after fetching.")
         self.assertEqual(tarfile.is_tarfile(pci.currentPath), True, "Gzip file was not a tar file after fetching.")
     finally:
         utilityFunctions.removeDir(tempDir)
Example #5
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)
Example #6
0
 def test_unpackZip(self):
     try:
         tempDir = mdTestUtilities.makeTempDir()
         zipDir, zipName = mdTestUtilities.createZipFile(tempDir)
         zipPath = os.path.join(tempDir, zipName)
         pci = createPythonCallInfo(zipPath, os.path.join(tempDir, "output"), os.path.join(tempDir, "download"))
         pci = steps.fetch(pci)
         self.assertEqual(pci.success, True, "Local Zip file failed to fetch.")
         self.assertEqual(os.path.exists(pci.currentPath), True, "Zip file did not exist after fetching.")
         self.assertEqual(zipfile.is_zipfile(pci.currentPath), True, "Zip file was not a tar file after fetching.")
         pci = steps.unpack(pci)
         self.assertEqual(pci.success, True, "Zip file failed to unpack.")
         self.assertEqual(os.path.isdir(pci.currentPath), True, "Zip file 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)
Example #7
0
 def test_fetchURL(self):
     try:
         tempDir = mdTestUtilities.makeTempDir()
         tarDir, tarName = mdTestUtilities.createGzipFile(tempDir)
         urlPath = "http://ftp.gnu.org/gnu/autoconf/autoconf-2.68.tar.gz"
         pci = createPythonCallInfo(urlPath,
                                    os.path.join(tempDir, "output"),
                                    os.path.join(tempDir, "download"))
         pci = steps.fetch(pci)
         self.assertEqual(pci.success, True,
                          "Gzip file failed to fetch from URL.")
         self.assertEqual(os.path.exists(pci.currentPath), True,
                          "Gzip file did not exist after fetching.")
         self.assertEqual(tarfile.is_tarfile(pci.currentPath), True,
                          "Gzip file was not a tar file after fetching.")
     finally:
         utilityFunctions.removeDir(tempDir)
Example #8
0
 def test_fetchGzip(self):
     try:
         tempDir = mdTestUtilities.makeTempDir()
         tarDir, tarName = mdTestUtilities.createGzipFile(tempDir)
         tarPath = os.path.join(tempDir, tarName)
         pci = createPythonCallInfo(tarPath,
                                    os.path.join(tempDir, "output"),
                                    os.path.join(tempDir, "download"))
         pci = steps.fetch(pci)
         self.assertEqual(pci.success, True,
                          "Local Gzip file failed to fetch.")
         self.assertEqual(os.path.exists(pci.currentPath), True,
                          "Gzip file did not exist after fetching.")
         self.assertEqual(tarfile.is_tarfile(pci.currentPath), True,
                          "Gzip file was not a tar file after fetching.")
     finally:
         utilityFunctions.removeDir(tempDir)
Example #9
0
 def test_unpackHg(self):
     if not hg.isHgInstalled():
         self.fail("Hg is not installed on your system.  All Hg tests will fail.")
     try:
         tempDir = mdTestUtilities.makeTempDir()
         repoPath = mdTestUtilities.createHgRepository(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, "Hg repository failed to fetch.")
         self.assertEqual(os.path.exists(testFilePath), True, "'" + mdTestUtilities.testFileName + "' did not exist after fetching a Hg repository.")
         pci = steps.unpack(pci)
         self.assertEqual(pci.success, True, "Hg repository failed to unpack.")
         self.assertEqual(os.path.isdir(pci.currentPath), True, "Hg 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)
Example #10
0
 def test_fetchHg(self):
     if not hg.isHgInstalled():
         self.fail(
             "Hg is not installed on your system.  All Hg tests will fail.")
     try:
         tempDir = mdTestUtilities.makeTempDir()
         repoPath = mdTestUtilities.createHgRepository(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,
                          "Hg repository failed to fetch.")
         self.assertEqual(
             os.path.exists(testFilePath), True,
             "'" + mdTestUtilities.testFileName +
             "' did not exist after fetching a Hg repository.")
     finally:
         utilityFunctions.removeDir(tempDir)