forked from cmacmackin/markdown-include
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_lines.py
26 lines (21 loc) · 819 Bytes
/
test_lines.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import os
from unittest import TestCase
from markdown_include.include import IncludePreprocessor
class TestProcessor(TestCase):
def setUp(self) -> None:
self.maxDiff = None
self.processor = IncludePreprocessor(None, {
"base_path": os.path.dirname(os.path.realpath(__file__)),
"encoding": "utf-8",
"inheritHeadingDepth": False,
"headingOffset": 0,
"throwException": False,
})
def test_lines(self):
source = ["Source file",
"# Heading Level 1 of main file",
"{!resources/header.md!}",
"## Heading Level 2 of main file",
"{!resources/header.md!}"]
result_lines = self.processor.run(source)
self.assertEqual(9, len(result_lines))