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)
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)
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)