예제 #1
0
    def test_bad_input(self):
        """Test retrieve_git_hash() catches directories that do not exist."""

        with self.assertRaises(IOError):
            repository_path = os.path.join(
                TMP_PATH,
                'does',
                'not',
                'exist',
            )
            retrieve_git_hash(repository_path)
예제 #2
0
    def test_retrieve(self):
        """Test retrieve_git_hash() can fetch git hash."""

        # Valid path, valid repository.
        repository_path = os.path.join(MCL_ROOT, '.git')
        hsh = retrieve_git_hash(repository_path)
        self.assertNotEqual(hsh, None)
        self.assertNotEqual(hsh, '')
        self.assertGreaterEqual(len(hsh), 1)

        # Valid path, no repository.
        repository_path = os.path.join(MCL_ROOT, 'mcl')
        hsh = retrieve_git_hash(repository_path)
        self.assertEqual(hsh, None)
예제 #3
0
파일: test_file.py 프로젝트: acfr/mcl
    def test_retrieve(self):
        """Test retrieve_git_hash() can fetch git hash."""

        # Valid path, valid repository.
        repository_path = os.path.join(MCL_ROOT, '.git')
        hsh = retrieve_git_hash(repository_path)
        self.assertNotEqual(hsh, None)
        self.assertNotEqual(hsh, '')
        self.assertGreaterEqual(len(hsh), 1)

        # Valid path, no repository.
        repository_path = os.path.join(MCL_ROOT, 'mcl')
        hsh = retrieve_git_hash(repository_path)
        self.assertEqual(hsh, None)
예제 #4
0
파일: test_file.py 프로젝트: acfr/mcl
    def test_bad_input(self):
        """Test retrieve_git_hash() catches directories that do not exist."""

        with self.assertRaises(IOError):
            repository_path = os.path.join(TMP_PATH, 'does', 'not', 'exist', )
            retrieve_git_hash(repository_path)