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)