tests: Allow for code block lines to be longer

Currently tests would fail if code block lines are longer than 79
characters, which is too restrictive as code blocks can contain
JSON or shell (or any other) code which should not be artificially
wrapped against it's natural formatting.

Change-Id: Iaf81d310f9406a23539efc3a3e2f25034ae39fa8
This commit is contained in:
Nikola Dipanov
2015-10-20 10:45:46 +01:00
parent 1d222ac16f
commit eafd8a25c5

View File

@@ -69,7 +69,16 @@ class TestTitles(testtools.TestCase):
% (filename, "\n ".join(msgs)))
def _check_lines_wrapping(self, tpl, raw):
code_block = False
for i, line in enumerate(raw.split("\n")):
# NOTE(ndipanov): Allow code block lines to be longer than 79 ch
if code_block:
if not line or line.startswith(" "):
continue
else:
code_block = False
if "::" in line:
code_block = True
if "http://" in line or "https://" in line:
continue
# Allow lines which do not contain any whitespace