summaryrefslogtreecommitdiff
path: root/tests/test_html.py
diff options
context:
space:
mode:
authorConrad Ho <none@none>2015-04-14 03:54:05 +0800
committerConrad Ho <none@none>2015-04-14 03:54:05 +0800
commita39ff9d5f9431229ca6b401380539b196ec9c8dd (patch)
treed88af014384d6b2a50f8f0f2ba8028de04962618 /tests/test_html.py
parente0ad5837194a4a8cd1a2ddf392c5b0db6a80e705 (diff)
downloadpython-coveragepy-git-a39ff9d5f9431229ca6b401380539b196ec9c8dd.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 6b398c43..d9a6470d 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."""