21 lines
765 B
Python
21 lines
765 B
Python
#!/usr/bin/env python3
|
|
import json
|
|
import subprocess
|
|
import unittest
|
|
|
|
|
|
class Axis3TutorialMotionTests(unittest.TestCase):
|
|
def test_motion(self) -> None:
|
|
result = subprocess.run(["node", "web/worker/test_axis3_tutorial_motion.mjs"], capture_output=True, text=True, check=False)
|
|
self.assertEqual(result.returncode, 0, result.stderr)
|
|
report = json.loads(result.stdout.strip().splitlines()[-1])
|
|
self.assertEqual(report["schema"], "axis3-tutorial-motion.v1")
|
|
self.assertEqual(report["status"], "verified")
|
|
self.assertNotEqual(report["positions"]["x"], 0)
|
|
self.assertNotEqual(report["positions"]["y"], 0)
|
|
self.assertNotEqual(report["positions"]["z"], 0)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|