Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mock mongodb backend in the test #176

Open
TooAngel opened this issue Oct 3, 2020 · 2 comments
Open

Mock mongodb backend in the test #176

TooAngel opened this issue Oct 3, 2020 · 2 comments

Comments

@TooAngel
Copy link
Owner

TooAngel commented Oct 3, 2020

Currently, the python tests are trying to connect to the MongoDB backend. AFAIK the tests don't use the backend and they shouldn't.
For faster and easier running of the tests, the MongoDB backend needs to be completely mocked.

@benji011
Copy link

benji011 commented Oct 3, 2020

Hi @TooAngel I'm kinda curious about this one. I'm trying to understand which tests should be mocked. I looked here but it looks like the tests are already covered by those patch decorators.

Please help me understand, which tests should be mocked/altered?

@TooAngel
Copy link
Owner Author

TooAngel commented Oct 3, 2020

Cool. I didn't look too much into it yet. I usually have a MongoDB server running on my machine. Yesterday I stopped it for reasons and recognized that the tests got stuck on the tests/test_frontend.py test already.

I would guess the issue lies in the fact that the mongo connection is already initiated in src/server.py, maybe we can mock this before the server.py is loaded.

Easiest to test, checkout the repository, run the tests without a MongoDB server listening on localhost:27017 and you should see the issue.

Does that help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants