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

Tests for DataCollection #307

Closed
wants to merge 10 commits into from
Closed

Tests for DataCollection #307

wants to merge 10 commits into from

Conversation

psomhorst
Copy link
Contributor

@psomhorst psomhorst commented Oct 9, 2024

Tests for DataCollections were missing. Three issues with DataCollection or data loading were found and fixed in this PR.

The tests cover 95% of the code in datacollection.py. The select_by_time() method is not tested for DataCollection[IntervalData] because select_by_time() is not finalised for IntervalData. Created #306 to add this test when #198 is fixed.

Closes #285 #286.

@psomhorst psomhorst force-pushed the 286_test_datacollection branch from 3fd942a to 99d93d8 Compare October 9, 2024 12:20
@psomhorst psomhorst force-pushed the 286_test_datacollection branch 2 times, most recently from bf4078a to 119524b Compare October 18, 2024 14:34
Copy link
Contributor

@JulietteFrancovich JulietteFrancovich left a comment

Choose a reason for hiding this comment

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

@psomhorst I have reviewed the tests for data collection. I think in general it is very clear and comprehensive. I have a few small questions/ suggestions.

tests/test_datacollection.py Show resolved Hide resolved
tests/test_datacollection.py Show resolved Hide resolved
tests/test_datacollection.py Show resolved Hide resolved
The omission of these line essentially disabled overwrite protection
if the key was not explicitly given. As this is/was the default way to
add items to a collection, the overwrite protection was essentially
unused.
`obj in v.derived_from` uses equality (==) rather than identity (is).
@psomhorst
Copy link
Contributor Author

@JulietteFrancovich Thanks for your suggestions. I added the requested tests.

@github-actions github-actions bot closed this Oct 29, 2024
@DaniBodor DaniBodor deleted the 286_test_datacollection branch October 29, 2024 13:59
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.

Write tests for DataCollection Overwrite protection for DataCollection does not work
2 participants