MCPcopy
hub / github.com/Python-Markdown/markdown / test

Method test

markdown/test_tools.py:150–166  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

148
149 def generate_test(infile, outfile, normalize, kwargs):
150 def test(self):
151 with open(infile, encoding="utf-8") as f:
152 input = f.read()
153 with open(outfile, encoding="utf-8") as f:
154 # Normalize line endings
155 # (on Windows, git may have altered line endings).
156 expected = f.read().replace("\r\n", "\n")
157 output = markdown(input, **kwargs)
158 if tidylib and normalize:
159 try:
160 expected = _normalize_whitespace(expected)
161 output = _normalize_whitespace(output)
162 except OSError:
163 self.skipTest("Tidylib's c library not available.")
164 elif normalize:
165 self.skipTest('Tidylib not available.')
166 self.assertMultiLineEqual(output, expected)
167 return test
168
169 location = dct.get('location', '')

Callers 1

parseBlocksMethod · 0.45

Calls 2

markdownFunction · 0.90
_normalize_whitespaceFunction · 0.85

Tested by

no test coverage detected