changeset 607:e9c80fcc5ae5 pytest2

test_location_breadcrumbs improved to check segment_name and item_name in themes/test_navi_bar
author pkumar <contactprashantat@gmail.com>
date Fri, 01 Jul 2011 18:02:08 +0530
parents caf03e340f75
children 27dc049120b1
files MoinMoin/themes/_tests/test_navi_bar.py
diffstat 1 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/themes/_tests/test_navi_bar.py	Fri Jul 01 12:32:16 2011 +0530
+++ b/MoinMoin/themes/_tests/test_navi_bar.py	Fri Jul 01 18:02:08 2011 +0530
@@ -35,8 +35,16 @@
             assert result == expected
 
     def test_location_breadcrumbs(self):
-        test_result = ThemeSupport.location_breadcrumbs(self.theme, 'test_item')
-        test_segment_name, test_item_name, test_item_exists = test_result[0]
-        assert test_segment_name == 'test_item'
-        assert test_item_name == 'test_item'
+        test_result = ThemeSupport.location_breadcrumbs(self.theme, 'some/place/test_item')
+        test_segment_name_1, test_item_name_1, test_item_exists_1 = test_result[0]
+        test_segment_name_2, test_item_name_2, test_item_exists_2 = test_result[1]
+        test_segment_name_3, test_item_name_3, test_item_exists_3 = test_result[2]
+         
+        assert test_segment_name_1 == 'some'
+        assert test_item_name_1 == 'some'
+        assert test_segment_name_2 == 'place'
+        assert test_item_name_2 == 'some/place'
+        assert test_segment_name_3 == 'test_item'
+        assert test_item_name_3 == 'some/place/test_item'
+