changeset 611:2c52e4d20d01 pytest2

test added for wikiutil.drawing2fname() in _tests/test_wikiutil
author pkumar <contactprashantat@gmail.com>
date Sun, 03 Jul 2011 16:51:58 +0530
parents 66b072c4ce8b
children a68688927b42
files MoinMoin/_tests/test_wikiutil.py
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/test_wikiutil.py	Sun Jul 03 16:24:51 2011 +0530
+++ b/MoinMoin/_tests/test_wikiutil.py	Sun Jul 03 16:51:58 2011 +0530
@@ -184,6 +184,16 @@
     result = wikiutil.ParentItemName(u'some/parent/itemname')
     expected = u'some/parent'
     assert result == expected, ('Expected "%(expected)s" but got "%(result)s"') % locals()
+
+def testdrawing2fname():
+    # with extension not in config.drawing_extensions
+    result = wikiutil.drawing2fname('Moin_drawing.txt')
+    expected = 'Moin_drawing.txt.tdraw'
+    assert result == expected
+    # with extension in config.drawing_extensions
+    result = wikiutil.drawing2fname('Moindir.Moin_drawing.jpg')
+    expected = 'Moindir.Moin_drawing.jpg'
+    assert result == expected    
     
 coverage_modules = ['MoinMoin.wikiutil']