From 76739f8000d0d1b66ace201e105e3c3c2cd6357f Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Wed, 6 Jun 2012 14:45:44 +0300 Subject: GitRepository: Implement status method Simple wrapper to the git-status command. Signed-off-by: Ed Bartosh Signed-off-by: Markus Lehtonen --- tests/test_GitRepository.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests') diff --git a/tests/test_GitRepository.py b/tests/test_GitRepository.py index c5c5849..d9fc539 100644 --- a/tests/test_GitRepository.py +++ b/tests/test_GitRepository.py @@ -881,6 +881,28 @@ def test_get_merge_base(): GitRepositoryError: Failed to get common ancestor: fatal: Not a valid object name doesnotexist """ +def test_status(): + r""" + Methods tested: + - L{gbp.git.GitRepository.status} + + >>> import gbp.git, os, shutil + >>> repo = gbp.git.GitRepository(repo_dir) + >>> fname = os.path.join(repo.path, "test_status") + >>> shutil.copy(os.path.join(repo.path, ".git/HEAD"), fname) + >>> repo.status().items() + [('??', ['test_status'])] + >>> repo.status(['bla*']).items() + [] + >>> repo.status(['te*']).items() + [('??', ['test_status'])] + >>> repo.add_files(repo.path, force=True) + >>> repo.commit_all(msg='added %s' % fname) + >>> _ = repo._git_inout('mv', [fname, fname + 'new']) + >>> repo.status().items() + [('R ', ['test_status\x00test_statusnew'])] + """ + def test_cmd_has_feature(): r""" Methods tested: -- cgit v1.2.3