changeset 622:f734d9a2bb57 pytest2

test added for themes.ThemeSupport.parent_item() in themes/test_navi_bar
author pkumar <contactprashantat@gmail.com>
date Wed, 06 Jul 2011 17:50:58 +0530
parents 65922348740b
children b46fbeae2939
files MoinMoin/themes/_tests/test_navi_bar.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/themes/_tests/test_navi_bar.py	Wed Jul 06 17:01:52 2011 +0530
+++ b/MoinMoin/themes/_tests/test_navi_bar.py	Wed Jul 06 17:50:58 2011 +0530
@@ -47,7 +47,12 @@
         assert test_item_name_2 == 'some/place'
         assert test_segment_name_3 == 'test_item'
         assert test_item_name_3 == 'some/place/test_item'
-        
+
+    def test_parent_item(self):
+        test_result = ThemeSupport.parent_item(self.theme, 'moin/moin-2.0/Item')
+        expected = 'moin/moin-2.0'
+        assert test_result == expected, ('Expected "%(expected)s" but got "%(test_result)s"') % locals()        
+
 def test_shorten_item_name():
     test_result1 = themes.shorten_item_name(u'MoinMoin/some/value', 0) 
     assert test_result1 == u'valu...lue'