Initial import of ORISYS arm workstation
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import threading
|
||||
import time
|
||||
from unittest import TestCase
|
||||
from unittest.mock import patch
|
||||
from station.runtime_client import RuntimeClient
|
||||
|
||||
|
||||
class ClientStateTest(TestCase):
|
||||
def test_paint_snapshot_is_local_and_stale_state_is_not_live(self):
|
||||
client=RuntimeClient.__new__(RuntimeClient)
|
||||
client._lock=threading.RLock();client.error=''
|
||||
client._snapshot={'now':time.time()-10,'arm_live':{'89':{'enabled':True,'pose_live':True}},
|
||||
'gripper_live':{'89':{'connected':True,'pose_live':True}}}
|
||||
with patch('station.rpc.call',side_effect=AssertionError('paint path must not perform RPC')):
|
||||
snapshot=client.snapshot()
|
||||
self.assertFalse(snapshot['arm_live']['89']['pose_live'])
|
||||
self.assertIsNone(snapshot['arm_live']['89']['enabled'])
|
||||
self.assertFalse(snapshot['gripper_live']['89']['connected'])
|
||||
self.assertTrue(client._snapshot['gripper_live']['89']['connected'])
|
||||
Reference in New Issue
Block a user