You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.
It looks like dependency injection lands itself perfectly for testing, so that the business logic (stories) could be tested with injecting dummy callables for data access which would return test entities.
But the project doesn't have any tests, so it doesn't demonstrate how this approach contributes to better testability...
Btw, is it necessary to use attrs for stories or it could be replaced with dataclasses?
The text was updated successfully, but these errors were encountered:
Hi, you are free to use attrs, dataclasses, pydantic, or old good __init__ method together with dependencies.
Usually, I override things with Injector.let in tests.
I replace only things I can't control like SMS gateways, API calls, SIP, Email, Facebook GraphQL API, etc.
A test usually calls stories for preparation, to do actual testing, and to validate the response.
So, it would be something like that:
It looks like dependency injection lands itself perfectly for testing, so that the business logic (stories) could be tested with injecting dummy callables for data access which would return test entities.
But the project doesn't have any tests, so it doesn't demonstrate how this approach contributes to better testability...
Btw, is it necessary to use
attrs
for stories or it could be replaced with dataclasses?The text was updated successfully, but these errors were encountered: