Appendix D. Mocking the CRICKIT library

This appendix covers the topic of mocking the Adafruit Python CRICKIT library. Mocking is a common mechanism used when testing software. It lets us replace a piece of software with mock objects. In our case, there are a number of benefits to doing this:

  • Running code without robot hardware—The mock library in this appendix will let us run all the code in the book without any robot hardware. This is useful, as it provides a deeper look at the computer vision, web, joystick, and networking portions of the code that don’t need robotic hardware.

  • Executing the code without a Raspberry Pi—The code is written to run on many different Linux systems. All the code was tested with Ubuntu 22.04, which can be run ...

Get Build Your Own Robot now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.