Skip to content

Commit 795c9d0

Browse files
committed
Tweaking the output format.
- Legacy-Id: 471
1 parent faeb7a1 commit 795c9d0

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

ietf/tests.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def run_tests(module_list, verbosity=1, extra_tests=[]):
2323
# during the search for a 'tests' module ...
2424
return django.test.simple.run_tests(module_list, verbosity, extra_tests)
2525

26-
def reduce(html, pre=False, fill=True):
26+
def reduce_text(html, pre=False, fill=True):
2727
if html.count("<li>") > 5*html.count("</li>"):
2828
html = html.replace("<li>", "</li><li>")
2929
html = re.sub(r"(?i)(RFC) (\d+)", r"\1\2", html) # ignore "RFC 1234" vs. "RFC1234" diffs
@@ -149,8 +149,6 @@ def module_setup(module):
149149
settings.DATABASE_NAME = module.testdb
150150
connection.cursor()
151151

152-
153-
154152
class UrlTestCase(TestCase):
155153

156154
def __init__(self, *args, **kwargs):
@@ -226,6 +224,7 @@ def doRedirectsTest(self, lst):
226224
response_count[res] = 0
227225
response_count[res] += 1
228226
if response_count:
227+
print ""
229228
note("Response count:")
230229
for res in response_count:
231230
ind, code = res
@@ -272,15 +271,15 @@ def doUrlsTest(self, lst):
272271
def sorted(l):
273272
l.sort()
274273
return l
275-
testtext = sorted(reduce(response.content, fill=False))
274+
testtext = sorted(reduce_text(response.content, fill=False))
276275
while testtext and not testtext[0]:
277276
del testtext[0]
278-
goodtext = sorted(reduce(goodhtml, fill=False))
277+
goodtext = sorted(reduce_text(goodhtml, fill=False))
279278
while goodtext and not goodtext[0]:
280279
del goodtext[0]
281280
else:
282-
testtext = reduce(response.content)
283-
goodtext = reduce(goodhtml)
281+
testtext = reduce_text(response.content)
282+
goodtext = reduce_text(goodhtml)
284283
if testtext == goodtext:
285284
note("OK cmp %s" % (url))
286285
else:
@@ -326,6 +325,7 @@ def sorted(l):
326325
else:
327326
pass
328327
if response_count:
328+
print ""
329329
note("Response count:")
330330
for res in response_count:
331331
ind, code = res

0 commit comments

Comments
 (0)