diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-10-11 11:01:12 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-10-11 11:01:12 +0200 |
commit | 9ee31065abea645cbc2cf3e54b691d5983a228b2 (patch) | |
tree | 21e38d54e5a69d2983906f6ac30e6322ed9a7ef1 /test/git/test_base.py | |
parent | 8430529e1a9fb28d8586d24ee507a8195c370fa5 (diff) | |
download | gitpython-9ee31065abea645cbc2cf3e54b691d5983a228b2.tar.gz |
Intermediate commit: commit,tree and blob objects now derive from object - test is in place which still fails on purpose. Need to integrate tags which can be objects or just a special form of a ref
Diffstat (limited to 'test/git/test_base.py')
-rw-r--r-- | test/git/test_base.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/git/test_base.py b/test/git/test_base.py new file mode 100644 index 00000000..46869f63 --- /dev/null +++ b/test/git/test_base.py @@ -0,0 +1,36 @@ +# test_base.py +# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors +# +# This module is part of GitPython and is released under +# the BSD License: http://www.opensource.org/licenses/bsd-license.php + +import time +from test.testlib import * +from git import * + +class TestBase(object): + + type_tuples = ( ("blob", "8741fc1d09d61f02ffd8cded15ff603eff1ec070"), + ("tree", "3a6a5e3eeed3723c09f1ef0399f81ed6b8d82e79"), + ("commit", "4251bd59fb8e11e40c40548cba38180a9536118c") ) + + def setup(self): + self.repo = Repo(GIT_REPO) + + def test_base(self): + # test interface of base classes + fcreators = (self.repo.blob, self.repo.tree, self.repo.commit ) + assert len(fcreators) == len(self.type_tuples) + for fcreator, (typename, hexsha) in zip(fcreators, self.type_tuples): + item = fcreator(hexsha) + assert item.id == hexsha + assert item.type == typename + assert item.size + # END for each object type to create + + assert False,"TODO: Test for all types" + + def test_tags(self): + # tag refs can point to tag objects or to commits + assert False, "TODO: Tag handling" + |