Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
58d5283
commit 74a2c70
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import predictive_punter | ||
|
||
|
||
def test_indexes(provider): | ||
"""The provider should create all necessary database indexes during initialisation""" | ||
|
||
expected_indexes = { | ||
predictive_punter.Sample: [ | ||
[('runner_id', 1)] | ||
] | ||
} | ||
|
||
for entity_type in expected_indexes: | ||
collection = provider.get_database_collection(entity_type) | ||
index_keys = [index['key'] for index in collection.index_information().values()] | ||
for expected_index in expected_indexes[entity_type]: | ||
assert expected_index in index_keys |