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

Fix: Make sure every TinyDB index db instance is closed #370

Merged
merged 1 commit into from
Jan 4, 2023

Conversation

reglim
Copy link
Contributor

@reglim reglim commented Dec 23, 2022

The index db connection is now generated in app.py and passed to the utils.

@@ -406,8 +406,8 @@ def test_index_all_projects_creates_file_and_version_index_api(client_with_claim

for project in projects:
for version in versions:
mock_insert_version_into_version_index.assert_any_call(docat.DOCAT_INDEX_PATH, project, version, [])
mock_insert_file_index_into_db.assert_any_call(docat.DOCAT_INDEX_PATH, project, version, "index.html", "hello world")
mock_insert_version_into_version_index.assert_any_call(ANY, project, version, [])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you use any here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I changed the parameter from the index db path to the actual db instance. I then passed in docat.index_db but the test failed all the time because it thought the two instances were different somehow

@randombenj randombenj merged commit 31ee0f5 into main Jan 4, 2023
@reglim reglim deleted the fix/362-fix-index-db-not-working-in-docker branch January 4, 2023 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants