2 ms·
>We need three layers of mocks to verify that an empty repositories key leads to an empty dictionary. And if I didn’t use a lambda for the json function, it wou
by pydry 4y ago
>We need three layers of mocks to verify that an empty repositories key leads to an empty dictionary. And if I didn’t use a lambda for the json function, it would be even four layers.
Yep, but those 4 or even 5 layers ought to be mostly reusable between one codebase that mocks an HTTP call and another - if they are abstracted away this line of reasoning falls apart, coz then it is simple.
I think the "what to mock?" argument suffers from an overabundance of dogma and a lack of trade-off based decision making. This article is one of many examples of this.