summaryrefslogtreecommitdiff
path: root/tests/test_html.py
diff options
context:
space:
mode:
authorConrad Ho <devnull@localhost>2015-04-14 03:54:05 +0800
committerConrad Ho <devnull@localhost>2015-04-14 03:54:05 +0800
commit61a07dc55be8b5c4028ebafe2e603335349358e2 (patch)
tree8e39e487de5caa0e9e8cc2fd1e0b1fbdcbd519a6 /tests/test_html.py
parente036d40450fd3a30a71a81f63054597bbfd0f168 (diff)
downloadpython-coveragepy-61a07dc55be8b5c4028ebafe2e603335349358e2.tar.gz
Ticket299: add time stamp to index.html reports page
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 6b398c4..d9a6470 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
@@ -323,7 +324,7 @@ class HtmlWithUnparsableFilesTest(HtmlTestHelpers, CoverageTest):
self.assertIn(expected, html_report)
-class HtmlTest(CoverageTest):
+class HtmlTest(HtmlTestHelpers, CoverageTest):
"""Moar HTML tests."""
def test_missing_source_file_incorrect_message(self):
@@ -353,6 +354,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 {}</p>".format(time_stamp), index)
+
class HtmlStaticFileTest(CoverageTest):
"""Tests of the static file copying for the HTML report."""