diff options
author | Ed Bartosh <eduard.bartosh@intel.com> | 2012-06-06 14:45:44 +0300 |
---|---|---|
committer | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2014-11-14 14:22:07 +0200 |
commit | 76a846a7eca34c457ed6d8eb67709013c2602731 (patch) | |
tree | 0a7ae8668808f99ccb52c5cce66ee6a67c7a0dc2 /tests | |
parent | 774cb7a57ed2bc8af1b8ed0ef10cf758587d8992 (diff) | |
download | git-buildpackage-76a846a7eca34c457ed6d8eb67709013c2602731.tar.gz git-buildpackage-76a846a7eca34c457ed6d8eb67709013c2602731.tar.bz2 git-buildpackage-76a846a7eca34c457ed6d8eb67709013c2602731.zip |
GitRepository: Implement status method
Simple wrapper to the git-status command.
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_GitRepository.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_GitRepository.py b/tests/test_GitRepository.py index 427370da..dadcee72 100644 --- a/tests/test_GitRepository.py +++ b/tests/test_GitRepository.py @@ -868,6 +868,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: |