Both method1 and method2 assume the correct operation of __init__, and additionally method2 assumes the correct operation of method1.
Tests for method2 would need to use a fake method1.
Pop quiz - unit testing during design
The tests we're building now are the foundation of the whole development process. The choices we make here affect everything that comes after; it's important to do it right.
If the people who write the specification aren't the same people who are writing the code, then it's important for the coders to start involving themselves as soon as possible, to keep the whole process within the bounds of what can usefully be done. If the specifiers are the ...
With Safari, you learn the way you learn best. Get unlimited access to videos, live online training,
learning paths, books, interactive tutorials, and more.