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

Automate dashboard scaffolding Part 1 #176

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

iantei
Copy link
Contributor

@iantei iantei commented Nov 27, 2024

This is part of series of PRs to automate the public dashboard.

In this PR, the focus is on testing certain functionality in scaffolding.py
The following have been tested for:

1. Approach direct function calls tests, instead of using mock.patch - to simplify
2. Tests mapping_lables for PURPOSE, REPLACED_MODE
3. Tests mapping_color_surveys
4. Tests get_quality_text()
5. Tests get_quality_text_sensed()
6. Tests get_quality_text_numerator()
7. Tests get_file_suffix()
8. Update unit tests for unit_conversion. Update distance column in the before_df and after_df data frame

iantei added 17 commits October 29, 2024 15:08
…since emission is two directory above the current test_*.py files directory. Used importlib as the parent directory has - in saved-notebooks.
- Executes all the unit test files available in the tests directory
- Test get_time_query() with the use of patch for LocalData and TimeComponentQuery
- Basic test case to assert cases for MODE mapping to en-translations
…adds unnecessary layer of complication over direct function calling. Both TimeComponentQuery and LocalDate calls inside get_time_query are straight forward, and would not need mocking.
@iantei iantei changed the title Automate dashboard scaffolding - 2 Automate dashboard scaffolding Part 2 Dec 5, 2024
@iantei iantei changed the title Automate dashboard scaffolding Part 2 Automate dashboard scaffolding Part 1 Dec 5, 2024
@iantei
Copy link
Contributor Author

iantei commented Feb 4, 2025

tests/test_plots.py::TestCalculatePct::test_calculate_pct_basic PASSED                                                                          [  5%]
tests/test_plots.py::TestCalculatePct::test_calculate_pct_empty PASSED                                                                          [ 10%]
tests/test_plots.py::TestCalculatePct::test_calculate_pct_single PASSED                                                                         [ 15%]
tests/test_plots.py::TestMergeSmallEntries::test_merge_small_entries_basic PASSED                                                               [ 21%]
tests/test_plots.py::TestMergeSmallEntries::test_merge_small_entries_no_small PASSED                                                            [ 26%]
tests/test_plots.py::TestMergeSmallEntries::test_merge_small_entries_some_small PASSED                                                          [ 31%]
tests/test_scaffolding.py::test_get_time_query PASSED                                                                                           [ 36%]
tests/test_scaffolding.py::test_mapping_labels PASSED                                                                                           [ 42%]
tests/test_scaffolding.py::test_mapping_color_surveys PASSED                                                                                    [ 47%]
tests/test_scaffolding.py::test_mapping_color_surveys_empty PASSED                                                                              [ 52%]
tests/test_scaffolding.py::test_get_quality_text PASSED                                                                                         [ 57%]
tests/test_scaffolding.py::test_get_quality_text_include_test_users PASSED                                                                      [ 63%]
tests/test_scaffolding.py::test_get_quality_text_include_mode_of_interest PASSED                                                                [ 68%]
tests/test_scaffolding.py::test_get_quality_text_sensed PASSED                                                                                  [ 73%]
tests/test_scaffolding.py::test_get_quality_text_sensed_include_test_users PASSED                                                               [ 78%]
tests/test_scaffolding.py::test_get_quality_text_numerator PASSED                                                                               [ 84%]
tests/test_scaffolding.py::test_get_quality_text_numerator_include_test_users PASSED                                                            [ 89%]
tests/test_scaffolding.py::test_get_file_suffix PASSED                                                                                          [ 94%]
tests/test_scaffolding.py::test_unit_conversions PASSED                                                                                         [100%]

@iantei iantei marked this pull request as ready for review February 4, 2025 19:37
@iantei
Copy link
Contributor Author

iantei commented Feb 4, 2025

Current coverage report:

plots.py                                                            303    248    18%
scaffolding.py                                                      345    248    28%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: PRs for review by peers
Development

Successfully merging this pull request may close these issues.

1 participant