diff tests/test_page.py @ 979:45ad976712ec

tests: Big push to get the tests to pass again. - Lots of fixes everywhere in the code. - Try to handle debug logging in the multiprocessing worker pool when running in pytest. Not perfect, but usable for now. - Replace all `.md` test files with `.html` since now a auto-format extension always sets the format. - Replace `out` with `outfiles` in most places since now blog archives are added to the bake output and I don't want to add expected outputs for blog archives everywhere.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 29 Oct 2017 22:51:57 -0700
parents 72f17534d58e
children
line wrap: on
line diff
--- a/tests/test_page.py	Sun Oct 29 22:46:41 2017 -0700
+++ b/tests/test_page.py	Sun Oct 29 22:51:57 2017 -0700
@@ -6,18 +6,18 @@
 test_parse_segments_data2 = ("Foo bar", {'content': 'Foo bar'})
 test_parse_segments_data3 = (
     """Something that spans
-    several lines
-    like this""",
+several lines
+like this""",
     {'content': """Something that spans
 several lines
 like this"""})
 test_parse_segments_data4 = (
     """Blah blah
-    ---foo---
-    Something else
-    ---bar---
-    Last thing
-    """,
+---foo---
+Something else
+---bar---
+Last thing
+""",
     {
         'content': "Blah blah\n",
         'foo': "Something else\n",
@@ -46,7 +46,7 @@
     ('blah foo\n', 2),
     ('blah foo\nmore here', 2),
     ('blah foo\nmore here\n', 3),
-    ('\nblah foo\nmore here\n', 3),
+    ('\nblah foo\nmore here\n', 4),
 ])
 def test_count_lines(text, expected):
     actual = _count_lines(text)
@@ -63,5 +63,5 @@
     ('\nblah foo\nmore here\n', 2, -1, 3),
 ])
 def test_count_lines_with_offsets(text, start, end, expected):
-    actual = _count_lines(text)
+    actual = _count_lines(text, start, end)
     assert actual == expected