Answer the question
In order to leave comments, you need to log in
Are there ready-made mocks for testing the database?
Faced a problem. I wanted to write unit tests for my service, I decided to mock the database. Some things (for example, Redis via aioredis) can still be manually locked (they are small, I use a dozen commands, it's easy to implement), but writing a mock for Mongodb via Motor, so that it would support GridFS (well, its methods) - that's another quest. Are there ready-made class implementations for database mocking?
Answer the question
In order to leave comments, you need to log in
Why wet the base? Raise the test base during tests, delete it after the tests.
Or mock the repository.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question