@@ -9,29 +9,35 @@ def setUp(self):
9
9
10
10
def test_should_be_correct (self ):
11
11
timestamp = self .interface .result .ms_to_timestamp (1533625284100.0 )
12
- assert timestamp == '20180807 07:01:24.100000'
12
+ self . assertEqual ( timestamp , '20180807 07:01:24.100000' )
13
13
14
14
timestamp = self .interface .result .ms_to_timestamp (1533625284451.0 )
15
- assert timestamp == '20180807 07:01:24.451000'
15
+ self . assertEqual ( timestamp , '20180807 07:01:24.451000' )
16
16
17
17
def test_should_be_associative (self ):
18
18
timestamp = '20180807 07:01:24.300000'
19
19
20
20
milliseconds = self .interface .result .timestamp_to_ms (timestamp )
21
- assert milliseconds == 1533625284300.0
21
+ self . assertEqual ( milliseconds , 1533625284300.0 )
22
22
23
23
timestamp = self .interface .result .ms_to_timestamp (milliseconds )
24
- assert timestamp == '20180807 07:01:24.300000'
24
+ self . assertEqual ( timestamp , '20180807 07:01:24.300000' )
25
25
26
26
milliseconds = self .interface .result .timestamp_to_ms (timestamp )
27
- assert milliseconds == 1533625284300.0
27
+ self . assertEqual ( milliseconds , 1533625284300.0 )
28
28
29
29
timestamp = self .interface .result .ms_to_timestamp (milliseconds )
30
- assert timestamp == '20180807 07:01:24.300000'
30
+ self . assertEqual ( timestamp , '20180807 07:01:24.300000' )
31
31
32
32
def _validate_timestamp (self , result ):
33
33
timestamp = result .ms_to_timestamp (- 10 )
34
- self .assertEqual (timestamp , '19700101 02:00:00.990000' )
34
+ expected = '19700101 00:00:00.990000'
35
+ # Windows 10 calculates epoch differently ( T ʖ̯ T)
36
+ import platform
37
+ if platform .system () == 'Windows' and platform .release () == '10' :
38
+ expected = '19700101 02:00:00.990000'
39
+
40
+ self .assertEqual (timestamp , expected )
35
41
36
42
def test_ms_before_epoch_are_reset_to_epoch (self ):
37
43
from oxygen .robot4_interface import RobotResultInterface as RF4ResultIface
@@ -47,19 +53,19 @@ def setUp(self):
47
53
48
54
def test_should_be_correct (self ):
49
55
milliseconds = self .iface .result .timestamp_to_ms ('20180807 07:01:24.000' )
50
- assert milliseconds == 1533625284000.0
56
+ self . assertEqual ( milliseconds , 1533625284000.0 )
51
57
52
58
milliseconds = self .iface .result .timestamp_to_ms ('20180807 07:01:24.555' )
53
- assert milliseconds == 1533625284555.0
59
+ self . assertEqual ( milliseconds , 1533625284555.0 )
54
60
55
61
def test_should_be_associative (self ):
56
62
milliseconds = 1533625284300.0
57
63
58
64
timestamp = self .iface .result .ms_to_timestamp (milliseconds )
59
- assert timestamp == '20180807 07:01:24.300000'
65
+ self . assertEqual ( timestamp , '20180807 07:01:24.300000' )
60
66
61
67
milliseconds = self .iface .result .timestamp_to_ms (timestamp )
62
- assert milliseconds == 1533625284300.0
68
+ self . assertEqual ( milliseconds , 1533625284300.0 )
63
69
64
70
timestamp = self .iface .result .ms_to_timestamp (milliseconds )
65
- assert timestamp == '20180807 07:01:24.300000'
71
+ self . assertEqual ( timestamp , '20180807 07:01:24.300000' )
0 commit comments