Brian is a Site Reliability Engineer at Twitter, where he maintains a robust suite of deployment and monitoring tools. He has also worked at Pinterest and Facebook, where he has worked on deployment, monitoring, and remediation tooling primarily using Python.
Python's mock library is a handy tool when you need to test your code and only your code. You can use mocks to replace calls to services and libraries that are outside of your code. In this talk, you'll get a breakdown of the features of mocks and several examples of how to implement mocks in your test code.
In this talk you will learn how to use the mock library for writing unit tests. This talk is broken into two basic halves:
Reading the docs: A description of implementations, and some small examples, of how the Mock library is instantiated and used.
Real world implementation: An array of code samples coupled with unit tests to demonstrate various approaches to how to review code and write a unit test.