Beispiel #1
0
class GitVCSTests(unittest2.TestCase):
    def setUp(self):
        self.config = Config()
        init_data = {}
        self.gitcvs = GitVCS(**init_data)

    def tearDown(self):
        self.config.reset_configuration()

    def test_find_commit(self):
        commits = self.gitcvs.get_commits()
        self.failIf(len(commits) == 0)
        expected = commits[0]
        result = self.gitcvs.find_commit(str(expected))[0]
        self.assertEquals(result.hexsha, expected.hexsha)
        self.assertEquals(type(result), type(expected))

    def test_git_stub(self):
        commit_hash = "76191292fe70015eeee241fb9b663af6953ffb5e"
        commits = self.gitcvs.get_commits()
        data = self.gitcvs.find_commit(commit_hash)

        if data is not None and len(data) > 2:
            commitA = data[0]
            commitB = commits[data[1] + 1]
            files_list = self.gitcvs.get_modified_files(commitB, commitA, None)
            expected_files = set()
            expected_files.add(".travis.yaml")
            expected_files.add(".travis.yml")
            expected_files.add("README.md")
            expected_files.add("build_thrift.sh")
            expected_files.add("setup.py")
            expected_files.add("thrift_medusa/config/travis-ci.yaml")
            for item in files_list:
                self.assertTrue(item in expected_files)
Beispiel #2
0
 def setUp(self):
     self.config = Config()
     init_data = {}
     self.gitcvs = GitVCS(**init_data)