summaryrefslogtreecommitdiff
path: root/tests/test_html.py
diff options
context:
space:
mode:
authorNed Batchelder <nedbat@gmail.com>2015-04-21 20:41:50 -0400
committerNed Batchelder <nedbat@gmail.com>2015-04-21 20:41:50 -0400
commitb976d22f5c6f9d42cbaf3bff5e3dd3faa0987838 (patch)
treef2ded3775959a61e54f388a240ccdfcf2da0553c /tests/test_html.py
parentfd311e747c67faa4e61873dcfefd4159b67f977a (diff)
parent0c7af8d745e18cd896b03b470fe527080413a4d7 (diff)
downloadpython-coveragepy-git-b976d22f5c6f9d42cbaf3bff5e3dd3faa0987838.tar.gz
Merged in conradho/coverage.py (pull request #47)
Ticket 299: Adding a time stamp to html report
Diffstat (limited to 'tests/test_html.py')
-rw-r--r--tests/test_html.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/test_html.py b/tests/test_html.py
index 004ebbfb..fd16fdd2 100644
--- a/tests/test_html.py
+++ b/tests/test_html.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
"""Tests that HTML generation is awesome."""
+import datetime
import os.path
import re
@@ -333,7 +334,7 @@ class HtmlWithUnparsableFilesTest(HtmlTestHelpers, CoverageTest):
self.assertIn("line_two", formfeed_html)
-class HtmlTest(CoverageTest):
+class HtmlTest(HtmlTestHelpers, CoverageTest):
"""Moar HTML tests."""
def test_missing_source_file_incorrect_message(self):
@@ -363,6 +364,14 @@ class HtmlTest(CoverageTest):
self.assert_exists("htmlcov/afile.html")
self.assert_exists("htmlcov/afile_py.html")
+ def test_has_date_stamp_in_index(self):
+ self.create_initial_files()
+ self.run_coverage()
+ with open("htmlcov/index.html") as f:
+ index = f.read()
+ time_stamp = datetime.datetime.now().strftime('%Y-%m-%d %H:%M')
+ self.assertIn("<p>Created on {time_stamp}</p>".format(time_stamp=time_stamp), index)
+
class HtmlStaticFileTest(CoverageTest):
"""Tests of the static file copying for the HTML report."""