python mock and libraries that are not installed
I am working on software for a robot, which is normally run on the Raspberry Pi. Let's consider the imports of two files: motor.py (runs the motors): from RPi import GPIO as gpio and client.py (communicates with the server and relays commands to the motors): from rpi.motor import Motor Both files are in a directory called rpi , which contains a __init__.py and a __main__.py . The RPi package cannot be installed on non-RPi devices. However, I still want to test the functionality of client.py . import unittest from unittest import mock # Location A class TestClient(unittest.TestCase): # Location