changeset 616:12057005a39f pytest2

added test for wikiutil.split_anchor() in _tests/test_wikiutil
author pkumar <contactprashantat@gmail.com>
date Mon, 04 Jul 2011 01:36:53 +0530
parents 6b173390b0e8
children 7899736d7ede
files MoinMoin/_tests/test_wikiutil.py
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/test_wikiutil.py	Mon Jul 04 01:03:54 2011 +0530
+++ b/MoinMoin/_tests/test_wikiutil.py	Mon Jul 04 01:36:53 2011 +0530
@@ -224,6 +224,21 @@
     #text without conflict marker
     result = wikiutil.containsConflictMarker('No conflict marker')
     assert result == False
+
+def testsplit_anchor():
+    """ 
+    TODO: add the test for for split_anchor when we have better
+          approach to deal wih problems like "#MoinMoin#" returning ("#MoinMoin", "")
+    """  
+    result = wikiutil.split_anchor('MoinMoin')
+    expected = 'MoinMoin', ''
+    assert result == expected 
+    result = wikiutil.split_anchor('MoinMoin#test_anchor|label|attr=val')
+    expected = ['MoinMoin', 'test_anchor|label|attr=val']
+    assert result == expected
+    result = wikiutil.split_anchor('#MoinMoin#')
+    expected = ['#MoinMoin', '']
+    assert result == expected
     
         
 coverage_modules = ['MoinMoin.wikiutil']