MHamzaRajput / 2022-test-existing-code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How To Write Unit Tests For Existing Python Code

In this two-part miniseries, I show you a practical example of adding unit tests to existing code. This first part focuses on adding tests while not changing the original code. There are also a few things in the test setup that are not ideal, like how dates are used in the test code, using a real API key and doing actual card charges. I address these things in part 2, where I also show how refactoring the code simplifies test writing while improving the design as well.

About

License:MIT License


Languages

Language:Python 99.7%Language:Shell 0.3%