Posts Categorized Under

Testing

  1. Modifying Your Code for Unit Testing

    Kate Green
    Kate Green

    Senior Automation Engineer

    If you’ve been looking for information on unit testing and how to put it into practice, you’re in the right place. This post explores evaluating your code to determine what to test, understanding how to break your code into smaller functions, and creating your tests. It also covers rudimentary mocking, which is the practice of writing pretend calls to test your code against predictable values.

  2. Revisiting Unit Testing and Mocking in Python

    Mike Lin
    Mike Lin

    Senior Software Engineer

    As a follow up to Python Mocking 101: Fake It Before You Make It, this post covers some higher-level software engineering principles demonstrated in our Python testing over the past year and half. In particular, the idea of patching mock objects in unit tests is revisited and explored in greater depth.

  3. Python Mocking 101: Fake It Before You Make It

    Mike Lin
    Mike Lin

    Senior Software Engineer

    In Python, mocking is accomplished through the unittest.mock module. The module contains a number of useful classes and functions, the most important of which are the patch function (as decorator and context manager) and the MagicMock class. Mocking in Python is largely accomplished through the use of these two powerful components.

Secure Your Cloud

Find security and compliance violations in your cloud infrastructure and ensure they never happen again.