Test high-precision timestamps in console log

Test that we detect microseconds correctly in console logs.

Change-Id: I922283891c557e489e4d75f17e78e8c31a5ca2ca
This commit is contained in:
Ian Wienand 2016-06-21 10:58:45 +10:00
parent 2fd29fe305
commit 85e117da7d
2 changed files with 14 additions and 0 deletions

View File

@ -110,6 +110,20 @@ class TestFilters(base.TestCase):
self.assertIn("<a name='_2013-09-27_18_09_18_784' "
"class='date' href='#_2013-09-27_18_09_18_784'>", line)
# We've snuck some high-precision microsecond timestamps as
# produced by zuul-runner in the end of this file; make sure
# they are recognised.
found = False
for line in gen:
look_for = "<span class='NONE _2013-09-27_18_47_33_342999'>" \
"<a name='_2013-09-27_18_47_33_342999' class='date' " \
"href='#_2013-09-27_18_47_33_342999'>" \
"2013-09-27 18:47:33.342999</a>"
if line.startswith(look_for):
found = True
self.assertTrue(found)
def test_html_escape(self):
gen = self.get_generator('screen-n-api-2.txt.gz')
# throw away header