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
+18
View File
@@ -0,0 +1,18 @@
from pathlib import Path
from tempfile import TemporaryDirectory
from unittest import TestCase
from unittest.mock import patch
from station import operator_teach as points
class PointsTest(TestCase):
def test_atomic_save_read_delete(self):
with TemporaryDirectory() as folder:
path=Path(folder)/'points.yaml'
with patch.object(points,'_file',return_value=path):
points._write('89',[{'name':'p1','utc':'test','joints':[.1]*7}])
self.assertTrue(path.is_file())
self.assertFalse(path.with_suffix('.yaml.tmp').exists())
self.assertEqual(points.list_points('89')['points'][0]['name'],'p1')
self.assertTrue(points.delete_point('89','p1')['ok'])
self.assertEqual(points.list_points('89')['points'],[])