diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-11-24 19:36:34 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-11-24 19:37:06 +0100 |
commit | 98a313305f0d554a179b93695d333199feb5266c (patch) | |
tree | 853a7029fa8c532da110b11afc2b60027e267625 /test/test_reflog.py | |
parent | 86523260c495d9a29aa5ab29d50d30a5d1981a0c (diff) | |
download | gitpython-98a313305f0d554a179b93695d333199feb5266c.tar.gz |
RefLog: added entry_at method, which is a faster way of reading single entries, including test
Diffstat (limited to 'test/test_reflog.py')
-rw-r--r-- | test/test_reflog.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test_reflog.py b/test/test_reflog.py index 520be590..5c4a21b8 100644 --- a/test/test_reflog.py +++ b/test/test_reflog.py @@ -79,6 +79,19 @@ class TestRefLog(TestBase): assert entry.newhexsha == 'f'*40 assert entry.message == msg assert RefLog.from_file(tfile)[-1] == entry + + # index entry + # raises on invalid index + self.failUnlessRaises(IndexError, RefLog.entry_at, rlp, 10000) + + # indices can be positive ... + assert isinstance(RefLog.entry_at(rlp, 0), RefLogEntry) + RefLog.entry_at(rlp, 23) + + # ... and negative + for idx in (-1, -24): + RefLog.entry_at(rlp, idx) + #END for each index to read # END for each reflog |