Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tattoo committed Oct 18, 2023
1 parent f1c9b29 commit ca4c970
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/oxygen/robot4_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
TestCase as RobotResultTest,
TestSuite as RobotResultSuite)

from robot.model import BodyItem

from robot.running.model import TestSuite as RobotRunningSuite


Expand Down Expand Up @@ -227,6 +225,8 @@ def spawn_robot_keyword(self,
start_timestamp = self.ms_to_timestamp(start_time)
end_timestamp = self.ms_to_timestamp(end_time)

# import this here so RF4 interface stays in parity with RF3
from robot.model import BodyItem
if setup:
keyword_type = BodyItem.SETUP
elif teardown:
Expand Down
10 changes: 9 additions & 1 deletion tests/utest/robot_interface/test_time_conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@ def test_should_be_associative(self):

def _validate_timestamp(self, result):
timestamp = result.ms_to_timestamp(-10)
self.assertEqual(timestamp, '19700101 02:00:00.990000')
expected = '19700101 00:00:01.990000'
# Windows 10 calculates epoch differently ( T ʖ̯ T)
import platform
if platform.system() == 'Windows'
expected = '19700101 00:00:00.990000'
if platform.release() == '10':
expected = '19700101 02:00:00.990000'

self.assertEqual(timestamp, expected)

def test_ms_before_epoch_are_reset_to_epoch(self):
from oxygen.robot4_interface import RobotResultInterface as RF4ResultIface
Expand Down

0 comments on commit ca4c970

Please sign in to comment.