diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2016-09-11 17:40:44 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2016-09-11 17:43:18 +0200 |
commit | 2ba897b12024fd20681b7c2f1b40bdbbccd5df59 (patch) | |
tree | fe1fca314bd72dfceadd36179867e43e9d66e341 /git/test/test_repo.py | |
parent | ae6e26ed4abac8b5e4e0a893da5546cd165d48e7 (diff) | |
download | gitpython-2ba897b12024fd20681b7c2f1b40bdbbccd5df59.tar.gz |
fix(repo): make it serializable with pickle
It's entirely untested if this repo still does the right thing,
but I'd think it does.
Fixes #504
Diffstat (limited to 'git/test/test_repo.py')
-rw-r--r-- | git/test/test_repo.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/git/test/test_repo.py b/git/test/test_repo.py index 17e990f9..e24062c1 100644 --- a/git/test/test_repo.py +++ b/git/test/test_repo.py @@ -4,6 +4,8 @@ # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php +import pickle + from git.test.lib import ( patch, TestBase, @@ -104,13 +106,15 @@ class TestRepo(TestBase): # try from invalid revision that does not exist self.failUnlessRaises(BadName, self.rorepo.tree, 'hello world') + + def test_pickleable(self): + pickle.loads(pickle.dumps(self.rorepo)) def test_commit_from_revision(self): commit = self.rorepo.commit('0.1.4') assert commit.type == 'commit' assert self.rorepo.commit(commit) == commit - def test_commits(self): mc = 10 commits = list(self.rorepo.iter_commits('0.1.6', max_count=mc)) assert len(commits) == mc |