I'm diving into my first serious PWB application. I'm using it as a library to
replace mwclient.
I'm not sure how to approach testing. I'd really like something which is isolated
from making actual API calls (i.e. hermetic unit tests). Does there exist a mechanism to
do that?
What I've been doing so far is using unittest.mock to create mock Page objects, but
that's not wondeful. unitest.mock is always a little clunky to use, but more than
that, it's too easy to create mocks that don't accurately emulate the real PWB
behaviors, so your tests aren't really testing what they should be. The other problem
is if you don't mock every possible code path to the backend API, you can end up
hitting a real server by accident during your tests. Which we be not a good thing.
How do people handle this?
Show replies by date