Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

Commit

Permalink
change testvalues to avoid failing float comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
ruleant committed Nov 24, 2015
1 parent e03caf2 commit f8fca5e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions buildtimetrend/test/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,9 @@
'timezone_offset': '+0000'
}

TIMESTAMP_FINISHED = 1396378871.234567
TIMESTAMP_NANO_FINISHED = 1396378871234567000
ISOTIMESTAMP_FINISHED = '2014-04-01T19:01:11.234567+00:00'
TIMESTAMP_FINISHED = 1396378871.234568
TIMESTAMP_NANO_FINISHED = 1396378871234567800
ISOTIMESTAMP_FINISHED = '2014-04-01T19:01:11.234568+00:00'
SPLIT_TIMESTAMP_FINISHED = {
'day_of_month': '01',
'day_of_week': '2',
Expand All @@ -238,13 +238,14 @@
'month_full_en': 'April',
'month_short_en': 'Apr',
'second': '11',
'microsecond': '234567',
'isotimestamp': '2014-04-01T19:01:11.234567+00:00',
'microsecond': '234568',
'isotimestamp': '2014-04-01T19:01:11.234568+00:00',
'timestamp_seconds': TIMESTAMP_FINISHED,
'year': '2014',
'timezone': 'UTC',
'timezone_offset': '+0000'
}
STAGE_DURATION = 371.2345681190491
STAGES_RESULT = [{'duration': 17,
'finished_at': SPLIT_TIMESTAMP4,
'name': 'stage1',
Expand Down
6 changes: 3 additions & 3 deletions buildtimetrend/test/stages_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def test_parse_timestamps_nanoseconds(self):
self.assertListEqual(
[
{
'duration': 371.2345669269562,
'duration': constants.STAGE_DURATION,
'finished_at': constants.SPLIT_TIMESTAMP_FINISHED,
'name': 'stage1',
'started_at': constants.SPLIT_TIMESTAMP_STARTED
Expand All @@ -208,7 +208,7 @@ def test_parse_timestamps_nanoseconds(self):
self.stages.stages)

# test total duration
self.assertEqual(371.2345669269562, self.stages.total_duration())
self.assertEqual(constants.STAGE_DURATION, self.stages.total_duration())

def test_create_stage(self):
self.assertEqual(
Expand All @@ -235,7 +235,7 @@ def test_create_stage(self):
)

self.assertDictEqual(
{'duration': 371.2345669269562,
{'duration': constants.STAGE_DURATION,
'finished_at': constants.SPLIT_TIMESTAMP_FINISHED,
'name': 'stage1',
'started_at': constants.SPLIT_TIMESTAMP_STARTED},
Expand Down

0 comments on commit f8fca5e

Please sign in to comment.