aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2013-09-04 11:58:21 +0300
committerGuido Günther <agx@sigxcpu.org>2013-09-04 22:36:31 +0200
commitbc409569f58a2c9c1c0393c923650bf84f159ddc (patch)
tree00b02c3a74ccebedeca9b29e49b78e8f52cc1abf /tests
parent171579fa5f27ea91563920d672c5b89d1c16f78b (diff)
GitRepository: Add clean() method
Signed-off-by: Lingchaox Xin <lingchaox.xin@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_GitRepository.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_GitRepository.py b/tests/test_GitRepository.py
index 699ecd44..187712e8 100644
--- a/tests/test_GitRepository.py
+++ b/tests/test_GitRepository.py
@@ -104,6 +104,24 @@ def test_branch_master():
'master'
"""
+def test_clean():
+ """
+ Remove untracked files from the working tree
+
+ Methods tested:
+ - L{gbp.git.GitRepository.clean}
+
+ >>> import gbp.git, shutil, os
+ >>> repo = gbp.git.GitRepository(repo_dir)
+ >>> shutil.copy(os.path.join(repo.path, ".git/HEAD"), \
+ os.path.join(repo.path, "testclean"))
+ >>> repo.clean(dry_run=True)
+ >>> repo.is_clean()[0]
+ False
+ >>> repo.clean(directories=True, force=True)
+ >>> repo.is_clean()[0]
+ True
+ """
def test_create_branch():
"""