diff options
Diffstat (limited to 'tests/test_html.py')
-rw-r--r-- | tests/test_html.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test_html.py b/tests/test_html.py index e1d41d93..06132fb4 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -317,9 +317,32 @@ class HtmlStaticFileTest(CoverageTest): cov = coverage.coverage() self.start_import_stop(cov, "main") cov.html_report() + jquery = open("htmlcov/jquery.min.js").read() self.assertEqual(jquery, "Not Really JQuery!") + def test_copying_static_files_from_system_in_dir(self): + # Make a new place for static files. + INSTALLED = [ + "jquery/jquery.min.js", + "jquery-hotkeys/jquery.hotkeys.js", + "jquery-isonscreen/jquery.isonscreen.js", + "jquery-tablesorter/jquery.tablesorter.min.js", + ] + for fpath in INSTALLED: + self.make_file(os.path.join("static_here", fpath), "Not real.") + coverage.html.STATIC_PATH.insert(0, "static_here") + + self.make_file("main.py", "print(17)") + cov = coverage.coverage() + self.start_import_stop(cov, "main") + cov.html_report() + + for fpath in INSTALLED: + the_file = os.path.basename(fpath) + contents = open(os.path.join("htmlcov", the_file)).read() + self.assertEqual(contents, "Not real.") + def test_cant_find_static_files(self): # Make the path point to useless places. coverage.html.STATIC_PATH = ["/xyzzy"] |