aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-10-27 20:57:16 +0200
committerGuido Günther <agx@sigxcpu.org>2011-10-27 22:08:00 +0200
commit1a590241a7b95f13784d735a2e6d34bde83ed31c (patch)
tree5d36f7d98d288182d8a4457a4bda9cee8e362f38 /tests
parentc4f9f23dace4b3ea87955f9ebe093f302b75f810 (diff)
GitRepository: Don't try to access .git/ in bare repos
Diffstat (limited to 'tests')
-rw-r--r--tests/test_GitRepository.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test_GitRepository.py b/tests/test_GitRepository.py
index 3f195455..404eb3a3 100644
--- a/tests/test_GitRepository.py
+++ b/tests/test_GitRepository.py
@@ -7,6 +7,8 @@ Test L{gbp.git.GitRepository}
import os
repo_dir = os.path.abspath(
os.path.join(os.path.curdir, 'gbp_%s_test_repo' % __name__))
+bare_dir = os.path.abspath(
+ os.path.join(os.path.curdir, 'gbp_%s_test_bare' % __name__))
clone_dir = os.path.abspath(
os.path.join(os.path.curdir, 'gbp_%s_test_clone' % __name__))
mirror_clone_dir = os.path.abspath(
@@ -317,12 +319,33 @@ def test_pull():
>>> clone.pull()
"""
+def test_create_bare():
+ """
+ Create a bare repository
+
+ Methods tested:
+ - L{gbp.git.GitRepository.create}
+ - L{gbp.git.GitRepository.is_empty}
+
+ >>> import gbp.git
+ >>> bare = gbp.git.GitRepository.create(bare_dir, bare=True, description="msg")
+ >>> bare.path == bare_dir
+ True
+ >>> bare.base_dir[:-1] == bare_dir
+ True
+ >>> type(bare) == gbp.git.GitRepository
+ True
+ >>> bare.is_empty()
+ True
+ """
+
def test_teardown():
"""
Perform the teardown
>>> import shutil, os
>>> os.getenv("GBP_TESTS_NOCLEAN") or shutil.rmtree(repo_dir)
+ >>> os.getenv("GBP_TESTS_NOCLEAN") or shutil.rmtree(bare_dir)
>>> os.getenv("GBP_TESTS_NOCLEAN") or shutil.rmtree(mirror_clone_dir)
>>> os.getenv("GBP_TESTS_NOCLEAN") or shutil.rmtree(clone_dir)
"""