Files
schn33fuchs 79d441a86e Motor
The raspi now controls a motor to lock unlock
2026-06-07 10:27:22 +02:00

41 lines
997 B
Python

import unittest
from raspi.motor import Raspi
class TestMotor(unittest.TestCase):
def setUp(self):
self.motor = Raspi()
def test_mock_unlock(self):
# Unlocking should not raise any errors, even if GPIO is not available
try:
self.motor.unlock()
success = True
except Exception:
success = False
self.assertTrue(success)
def test_mock_lock(self):
try:
self.motor.lock()
success = True
except Exception:
success = False
self.assertTrue(success)
def test_mock_async_unlock(self):
try:
self.motor.unlock_async()
success = True
except Exception:
success = False
self.assertTrue(success)
def test_mock_async_lock(self):
try:
self.motor.lock_async()
success = True
except Exception:
success = False
self.assertTrue(success)