Ronny Pfannschmidt avatar Ronny Pfannschmidt committed 3500ee5

move the blockread tests to a unified test file

Comments (0)

Files changed (2)

+import pprint
+from regendoc import blocks
+
+input_data_for_blocks = """
+some text
+more text
+
+next block::
+
+    indent
+      block
+
+    with more
+
+.. directive:: test
+    :param: test
+
+    text
+"""
+
+def test_blocks():
+    result = blocks(input_data_for_blocks.splitlines(True))
+    expected = [
+        # indent level, start line, lines
+        (0, 1, ['some text\n', 'more text\n', '\n', 'next block::\n']),
+        (4, 6, ['indent\n', '  block\n', '\n', 'with more\n']),
+        (0, 11, ['.. directive:: test\n']),
+        (4, 12, [':param: test\n', '\n', 'text\n'])
+    ]
+    pprint.pprint(result)
+    assert result == expected
+
+

testing/test_blockread.py

-from regendoc import blocks
-import pprint
-
-input_data = """
-some text
-more text
-
-next block::
-
-    indent
-      block
-
-    with more
-
-.. directive:: test
-    :param: test
-
-    text
-"""
-
-def test_blocks():
-    result = blocks(input_data.splitlines(True))
-    expected = [
-        # indent level, start line, lines
-        (0, 1, ['some text\n', 'more text\n', '\n', 'next block::\n']),
-        (4, 6, ['indent\n', '  block\n', '\n', 'with more\n']),
-        (0, 11, ['.. directive:: test\n']),
-        (4, 12, [':param: test\n', '\n', 'text\n'])
-    ]
-    pprint.pprint(result)
-    assert result == expected
-
-
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.