Test code that parses json and ip ranges
Level: Intermediate (score: 3)
We moved from mutpy
(<= 3.7) to mutatest
(3.12 π) for test Bites.
First we check if you have 90% test coverage, then we inject some mutations into the code to see if your tests catch them. π€―
Good luck π₯ πͺ (please be patient π - it can take a few seconds to run the tests π)
Another Test Bite, we β€οΈthem π- today you will write tests for IPv4Network
(ipaddress
module) and dataclass objects πͺ.
Check out the ips
module I wrote parsing a JSON file of IP ranges (ip-ranges.json) under CODE TO TEST, then write tests to get to 100% test coverage and a 100% mutation score.
Good luck and keep calm and code in Python π and pytest
. Share your accomplishment upon completing the Bite π