Initial import of ORISYS arm workstation

This commit is contained in:
cheng
2026-10-16 17:27:30 +08:00
commit 2b74c50ba8
745 changed files with 1199101 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
from unittest import TestCase
from station.subscriptions import SubscriptionSet, demanded_streams
class SubscriptionsTest(TestCase):
def test_switches_release_unused_real_sim_depth(self):
cams=[{'id':'left'},{'id':'right'},{'id':'sim_wrist'},{'id':'overhead'}]
subscriptions=SubscriptionSet();created=[];destroyed=[]
def create(key): created.append(key);return key
def sync(preview=(),jpeg=()):
subscriptions.sync(demanded_streams(cams,preview,jpeg),create,destroyed.append)
sync(['left_color','overhead_color'])
self.assertEqual(set(created),{'left_color','overhead_color'})
sync(['right_depth','overhead_depth'])
self.assertEqual(set(subscriptions.items),{'right_depth','overhead_depth'})
self.assertEqual(set(destroyed),{'left_color','overhead_color'})
sync([],['left_color'])
self.assertEqual(set(subscriptions.items),{'left_color'})
sync(['sim_wrist_color'])
self.assertEqual(set(subscriptions.items),{'sim_wrist_color'})
sync();self.assertEqual(subscriptions.items,{})
sync(['unknown_color']);self.assertEqual(subscriptions.items,{})