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

59 behave tests improvement #65

Merged
merged 27 commits into from
Nov 23, 2023
Merged

Conversation

carlkidcrypto
Copy link
Owner

Because PurpleAirAPI now has limitations on API calls and a "Pay-To-Use" model, the tests are now unit tests instead of behavior tests. I'll leave the old behavior tests around for a bit. The new tests live under tests

- attempt to mock out the get/post/delete calls the api is doing.
- refactor code from classes that don't need the self_ arguments into a helpers file
- started to use unittest files for testing. The behave tests were great until the PurpleAir API team put limits/quotas on their public API.
- enabling the tests action for now.
- fixes so that it runs
- added test_construct_store_sensor_data_type
- testing as much as possible for PurpleAirDataLogger public interfaces. Next step is move out more logic so the while true loops just call other functions that can be tested individually
- added new method flatten_single_sensor_data so that it can be tested in isolation from the run method.
- adding more test coverage.
- created a helpers file for the tests.
- fixed invalid json in one of the sample files.
- done with test_flatten_single_sensor_data
- test optimization. Moving more stuff out to helpers to keep main test file clean.
- more moving of logic from data logger to helpers file. That what it can be tested.
- adding what needs to be covered
- filled out test_logic_for_storing_single_sensor_data and figured out unittest.mocks :)
- flushed out test_logic_for_storing_multiple_sensors_data
- adding coverage for test_logic_for_storing_group_sensors_data
- added more cover for group sensor logic. adding and not adding sensor group
- fixing the coverage for group logic
- even more coverage for group sensors
- adding more group sensor logic coverage
- fixing imports for github action
- ran black again
- adding coverage for local sensors
- adding more coverage for the local api
- renamed a few vars to indicate what is for local api tests
- sphinx docs with new helpers module
@carlkidcrypto carlkidcrypto self-assigned this Nov 23, 2023
@carlkidcrypto carlkidcrypto linked an issue Nov 23, 2023 that may be closed by this pull request
Copy link

codecov bot commented Nov 23, 2023

Welcome to Codecov 🎉

Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment.

Thanks for integrating Codecov - We've got you covered ☂️

@carlkidcrypto carlkidcrypto merged commit 38cda07 into main Nov 23, 2023
4 of 5 checks passed
@carlkidcrypto carlkidcrypto deleted the 59-behave-tests-improvement branch November 23, 2023 20:15
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.

Behave Tests Improvement
1 participant