From 30078270bb77554829210b5fae3faf717e67da7f Mon Sep 17 00:00:00 2001
From: Julien Miotte <mike.perdide@gmail.com>
Date: Mon, 11 Jul 2011 22:23:01 +0200
Subject: [PATCH] Adding a test on Tree objects iteration.

---
 test/test_tree.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/test/test_tree.py b/test/test_tree.py
index bcbac31..b48308f 100644
--- a/test/test_tree.py
+++ b/test/test_tree.py
@@ -108,6 +108,16 @@ class TreeTest(utils.BareRepoTestCase):
         self.assertRaises(TypeError, operator.setitem, 'c', tree['a'])
         self.assertRaises(TypeError, operator.delitem, 'c')
 
+    def test_iterate_tree(self):
+        """
+            Testing that we're able to iterate of a Tree object and that the
+            resulting sha strings are consitent with the sha strings we could
+            get with other Tree access methods.
+        """
+        tree = self.repo[TREE_SHA]
+        for tree_entry in tree:
+            self.assertEqual(tree_entry.sha, tree[tree_entry.name].sha)
+
 
 if __name__ == '__main__':
   unittest.main()