changeset 2486:c022854d3895

Use .splitlines() for markup tests
author Sam Toyer <sam@qxcv.net>
date Fri, 24 Jun 2016 17:39:37 +1000
parents c2bd1f3dcd4b
children 904b232d37bc
files tests/test_hatta.py tests/test_parser.py
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test_hatta.py	Fri Jun 24 14:42:58 2016 +1000
+++ b/tests/test_hatta.py	Fri Jun 24 17:39:37 2016 +1000
@@ -138,7 +138,7 @@
             return u"<a></a>"
         def image(addr, label=None, class_=None, image=None, alt=None):
             return u"<img>"
-        lines = '\n\r'.join(text.split('\n')).split('\r')
+        lines = text.splitlines(True)
         return u''.join(parser(lines, link, image))
 
 
--- a/tests/test_parser.py	Fri Jun 24 14:42:58 2016 +1000
+++ b/tests/test_parser.py	Fri Jun 24 17:39:37 2016 +1000
@@ -63,11 +63,11 @@
     return DummyPage().highlight(text, mime, syntax, line_no)
 
 def parse(text):
-    lines = '\n\r'.join(text.split('\n')).split('\r')
+    lines = text.splitlines(True)
     return HTML(u''.join(hatta.parser.WikiParser(lines, link, img, hgh)))
 
 def wiki_parse(text):
-    lines = '\n\r'.join(text.split('\n')).split('\r')
+    lines = text.splitlines(True)
     return HTML(u''.join(hatta.parser.WikiWikiParser(lines, link, img, hgh)))