summaryrefslogtreecommitdiff
path: root/test/test_reflog.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_reflog.py')
-rw-r--r--test/test_reflog.py13
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