summaryrefslogtreecommitdiff
path: root/test/git/test_index.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-10-21 13:34:43 +0200
committerSebastian Thiel <byronimo@gmail.com>2009-10-21 13:34:43 +0200
commitb9d6494f1075e5370a20e406c3edb102fca12854 (patch)
tree89d812191bbaefd234f1d3c53a973a8332732c24 /test/git/test_index.py
parent152bab7eb64e249122fefab0d5531db1e065f539 (diff)
downloadgitpython-b9d6494f1075e5370a20e406c3edb102fca12854.tar.gz
index writing added including simple test, improved docs of IndexEntry
Diffstat (limited to 'test/git/test_index.py')
-rw-r--r--test/git/test_index.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/git/test_index.py b/test/git/test_index.py
index 86bde655..7a0e21eb 100644
--- a/test/git/test_index.py
+++ b/test/git/test_index.py
@@ -7,6 +7,7 @@
from test.testlib import *
from git import *
import inspect
+import os
class TestTree(TestCase):
@@ -30,8 +31,13 @@ class TestTree(TestCase):
# test stage
index_merge = Index.from_file(fixture_path("index_merge"))
+ assert len(index_merge.entries) == 106
assert len(list(e for e in index_merge.entries.itervalues() if e.stage != 0 ))
- # write
- self.fail("writing, what is 'size' attribute for ?")
+ # write the data - it must match the original
+ index_output = os.tmpfile()
+ index_merge.write(index_output)
+
+ index_output.seek(0)
+ assert index_output.read() == fixture("index_merge")