changeset 613:cdfb5c99b774 pytest2

added test for wikiutil.getUnicodeIndexGroup() in _test/test_wikiutil.
author pkumar <contactprashantat@gmail.com>
date Sun, 03 Jul 2011 18:12:04 +0530
parents a68688927b42
children b016b5b3c0e2
files MoinMoin/_tests/test_wikiutil.py
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/test_wikiutil.py	Sun Jul 03 16:56:50 2011 +0530
+++ b/MoinMoin/_tests/test_wikiutil.py	Sun Jul 03 18:12:04 2011 +0530
@@ -189,11 +189,20 @@
     # with extension not in config.drawing_extensions
     result = wikiutil.drawing2fname('Moin_drawing.txt')
     expected = 'Moin_drawing.txt.tdraw'
-    assert result == expected, ('Expected "%(expected)s" but got "%(result)s"') % locals())
+    assert result == expected, ('Expected "%(expected)s" but got "%(result)s"') % locals()
     # with extension in config.drawing_extensions
     result = wikiutil.drawing2fname('Moindir.Moin_drawing.jpg')
     expected = 'Moindir.Moin_drawing.jpg'
-    assert result == expected, ('Expected "%(expected)s" but got "%(result)s"') % locals())    
+    assert result == expected, ('Expected "%(expected)s" but got "%(result)s"') % locals()    
+
+def testgetUnicodeIndexGroup():
+    result = wikiutil.getUnicodeIndexGroup(['moin-2', 'MoinMoin'])
+    expected = 'MOIN-2'
+    assert result == expected, ('Expected "%(expected)s" but got "%(result)s"') % locals()    
+    # empty char
+    with pytest.raises(IndexError):
+        result = wikiutil.getUnicodeIndexGroup('')
+        
     
 coverage_modules = ['MoinMoin.wikiutil']