Initial import of ORISYS arm workstation
This commit is contained in:
@@ -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'],[])
|
||||
Reference in New Issue
Block a user