コード例 #1
0
ファイル: test_git.py プロジェクト: tepperly/MixDown
    def test_isGitRepoCase2(self):
        #Case 2: URL that is a git repository
        if not git.isGitInstalled():
            self.fail("Git is not installed on your system.  All Git tests will fail.")

        path = "http://github.com/tepperly/MixDown.git"
        self.assertTrue(git.isGitRepo(path), "git.isGitRepo(" + path + ") should have returned true.")
        #Test if wrong path returns false
        falsePath = "http://foo/wrong/path"
        returnValue = git.isGitRepo(falsePath)
        self.assertEqual(returnValue, False, "git.isGitRepo(" + falsePath + ") should have returned false.")
コード例 #2
0
ファイル: test_git.py プロジェクト: tepperly/MixDown
 def test_isGitRepoCase1(self):
     #Case 1: Local directory that is a git repository
     if not git.isGitInstalled():
         self.fail("Git is not installed on your system.  All Git tests will fail.")
     #Create repository and test if is git repo
     tempDir = mdTestUtilities.makeTempDir()
     tempRepo = mdTestUtilities.createGitRepository(tempDir)
     try:
         self.assertTrue(git.isGitRepo(tempRepo), "git.isGitRepo(" + tempRepo + ") should have returned true.")
     finally:
         utilityFunctions.removeDir(tempDir)
     #Test if wrong path returns false
     falsePath = "/foo/wrong/path"
     self.assertFalse(git.isGitRepo(falsePath), "git.isGitRepo(" + falsePath + ") should have returned false.")
コード例 #3
0
ファイル: test_git.py プロジェクト: tepperly/MixDown
    def test_isGitRepoCase4(self):
        #Case 4: Check for false positive with .gz files
        if not git.isGitInstalled():
            self.fail("Git is not installed on your system.  All Git tests will fail.")

        #Local file
        try:
            tempDir = mdTestUtilities.makeTempDir()
            tarDir, path = mdTestUtilities.createGzipFile(tempDir)
            self.assertFalse(git.isGitRepo(path), "git.isGitRepo(" + path + ") should have returned false.")
        finally:
            utilityFunctions.removeDir(tempDir)

        #Remote file
        path = "http://www.eng.lsu.edu/mirrors/apache//apr/apr-util-1.3.10.tar.gz"
        self.assertFalse(git.isGitRepo(path), "git.isGitRepo(" + path + ") should have returned false.")
コード例 #4
0
ファイル: test_git.py プロジェクト: cosmicexplorer/MixDown
    def test_isGitRepoCase2(self):
        #Case 2: URL that is a git repository
        if not git.isGitInstalled():
            self.fail(
                "Git is not installed on your system.  All Git tests will fail."
            )

        path = "http://github.com/tepperly/MixDown.git"
        self.assertTrue(
            git.isGitRepo(path),
            "git.isGitRepo(" + path + ") should have returned true.")
        #Test if wrong path returns false
        falsePath = "http://foo/wrong/path"
        returnValue = git.isGitRepo(falsePath)
        self.assertEqual(
            returnValue, False,
            "git.isGitRepo(" + falsePath + ") should have returned false.")
コード例 #5
0
ファイル: test_git.py プロジェクト: cosmicexplorer/MixDown
 def test_isGitRepoCase1(self):
     #Case 1: Local directory that is a git repository
     if not git.isGitInstalled():
         self.fail(
             "Git is not installed on your system.  All Git tests will fail."
         )
     #Create repository and test if is git repo
     tempDir = mdTestUtilities.makeTempDir()
     tempRepo = mdTestUtilities.createGitRepository(tempDir)
     try:
         self.assertTrue(
             git.isGitRepo(tempRepo),
             "git.isGitRepo(" + tempRepo + ") should have returned true.")
     finally:
         utilityFunctions.removeDir(tempDir)
     #Test if wrong path returns false
     falsePath = "/foo/wrong/path"
     self.assertFalse(
         git.isGitRepo(falsePath),
         "git.isGitRepo(" + falsePath + ") should have returned false.")
コード例 #6
0
ファイル: test_git.py プロジェクト: cosmicexplorer/MixDown
    def test_isGitRepoCase4(self):
        #Case 4: Check for false positive with .gz files
        if not git.isGitInstalled():
            self.fail(
                "Git is not installed on your system.  All Git tests will fail."
            )

        #Local file
        try:
            tempDir = mdTestUtilities.makeTempDir()
            tarDir, path = mdTestUtilities.createGzipFile(tempDir)
            self.assertFalse(
                git.isGitRepo(path),
                "git.isGitRepo(" + path + ") should have returned false.")
        finally:
            utilityFunctions.removeDir(tempDir)

        #Remote file
        path = "http://www.eng.lsu.edu/mirrors/apache//apr/apr-util-1.3.10.tar.gz"
        self.assertFalse(
            git.isGitRepo(path),
            "git.isGitRepo(" + path + ") should have returned false.")