From 2dabfe9fd409da422df5154c2d10612738d0242b Mon Sep 17 00:00:00 2001 From: Wolfgang Resch Date: Thu, 14 May 2015 20:44:55 -0400 Subject: [PATCH] changed the html output from nosetests to make it compatible with the hpc.nih.gov sites. Can be concatenated with doc_header and doc_footer --- .gitignore | 3 +++ pbs2slurm_tests.py | 45 +++++++-------------------------------------- 2 files changed, 10 insertions(+), 38 deletions(-) diff --git a/.gitignore b/.gitignore index 4f3aa9f..766b823 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ *.pyc testcases.html +doc_footer.html +doc_header.html +*.swp diff --git a/pbs2slurm_tests.py b/pbs2slurm_tests.py index 72ae2e8..6abbef0 100644 --- a/pbs2slurm_tests.py +++ b/pbs2slurm_tests.py @@ -8,14 +8,12 @@ html = open("testcases.html", "w") - def html_out(fh, ok, pbs, slurm, desc): pbss = pbs.replace(">", ">").replace("<", "<") slurms = slurm.replace(">", ">").replace("<", "<") fh.write(""" - {desc} - {ok} - + {desc}{ok} +
{pbss}
@@ -25,49 +23,20 @@ def html_out(fh, ok, pbs, slurm, desc): """.format(**locals())) def html_header(fh): - fh.write(""" - -pbs2slurm test cases - - - + fh.write("""
- - - +
PBS script
+ """) -def html_footer(fh): - fh.write(""" -
PBS script SLURM script
-
- -""") - fh.close() - html_header(html) -atexit.register(html_footer, html) def check(input, exp, obs, desc): if exp != obs: - pf = """

FAIL

""" + pf = """FAIL""" html_out(html, pf, input, exp, desc) d = difflib.Differ() sys.stdout.writelines(d.compare( @@ -75,7 +44,7 @@ def check(input, exp, obs, desc): obs.splitlines(1))) assert False else: - pf = """

OK

""" + pf = """OK""" html_out(html, pf, input, exp, desc)