Skip to content

Commit

Permalink
work around timing issue in whisper reader interval tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DanCech committed Dec 6, 2017
1 parent 4c5a7c4 commit 8649f6f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions webapp/tests/test_readers_whisper.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ def test_GzippedWhisperReader_get_intervals(self):
ts = int(time.time())
intervals = reader.get_intervals()
for interval in intervals:
self.assertEqual(int(interval.start), ts-60)
self.assertEqual(int(interval.end), ts)
self.assertEqual(int(interval.start), ts - 60)
self.assertIn(int(interval.end), [ts, ts - 1])

# read it again to validate cache works
intervals = reader.get_intervals()
for interval in intervals:
self.assertEqual(int(interval.start),ts-60)
self.assertEqual(int(interval.end), ts)
self.assertEqual(int(interval.start),ts - 60)
self.assertIn(int(interval.end), [ts, ts - 1])

# Confirm fetch works.
def test_GzippedWhisperReader_fetch(self):
Expand Down Expand Up @@ -120,14 +120,14 @@ def test_WhisperReader_get_intervals(self):
ts = int(time.time())
intervals = reader.get_intervals()
for interval in intervals:
self.assertEqual(int(interval.start),ts-60)
self.assertEqual(int(interval.end), ts)
self.assertEqual(int(interval.start),ts - 60)
self.assertIn(int(interval.end), [ts, ts - 1])

# read it again to validate cache works
intervals = reader.get_intervals()
for interval in intervals:
self.assertEqual(int(interval.start),ts-60)
self.assertEqual(int(interval.end), ts)
self.assertEqual(int(interval.start),ts - 60)
self.assertIn(int(interval.end), [ts, ts - 1])

# Confirm get_raw_step works
def test_WhisperReader_get_raw_step(self):
Expand Down

0 comments on commit 8649f6f

Please sign in to comment.