diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/git/test_fun.py | 9 | ||||
-rw-r--r-- | test/git/test_index.py | 9 |
2 files changed, 12 insertions, 6 deletions
diff --git a/test/git/test_fun.py b/test/git/test_fun.py index ce610014..b2b94415 100644 --- a/test/git/test_fun.py +++ b/test/git/test_fun.py @@ -60,6 +60,9 @@ class TestFun(TestBase): M = tree("44a601a068f4f543f73fd9c49e264c931b1e1652") trees = [B.sha, H.sha, M.sha] self._assert_index_entries(aggressive_tree_merge(odb, trees), trees) + + # too many trees + self.failUnlessRaises(ValueError, aggressive_tree_merge, odb, trees*2) def mktree(self, odb, entries): """create a tree from the given tree entries and safe it to the database""" @@ -164,14 +167,10 @@ class TestFun(TestBase): # as one is deleted, there are only 2 entries assert_entries(aggressive_tree_merge(odb, trees), 2, True) # END handle ours, theirs - - - - def _assert_tree_entries(self, entries, num_trees): - assert len(entries[0]) == num_trees for entry in entries: + assert len(entry) == num_trees paths = set(e[2] for e in entry if e) # only one path per set of entries diff --git a/test/git/test_index.py b/test/git/test_index.py index ae754430..35580135 100644 --- a/test/git/test_index.py +++ b/test/git/test_index.py @@ -594,6 +594,13 @@ class TestIndex(TestBase): # END for each commit def test_index_new(self): - self.fail("todo index new") + B = self.rorepo.tree("6d9b1f4f9fa8c9f030e3207e7deacc5d5f8bba4e") + H = self.rorepo.tree("25dca42bac17d511b7e2ebdd9d1d679e7626db5f") + M = self.rorepo.tree("e746f96bcc29238b79118123028ca170adc4ff0f") + + for args in ((B,), (B,H), (B,H,M)): + index = IndexFile.new(self.rorepo, *args) + assert isinstance(index, IndexFile) + # END for each arg tuple |