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 2 #177

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

Conversation

iantei
Copy link
Contributor

@iantei iantei commented Nov 28, 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. filter_labeled_trips()
2. expand_userinputs()
3. translate_values_to_labels()

iantei added 21 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.
…date unit tests for translate_values_to_labels()
@iantei iantei changed the title Automate dashboard scaffolding v2 Automate dashboard scaffolding Part 2 Dec 5, 2024
@iantei iantei changed the base branch from main to fix_start_notebook_path February 7, 2025 16:49
@iantei iantei changed the base branch from fix_start_notebook_path to main February 7, 2025 16:50
@iantei
Copy link
Contributor Author

iantei commented Feb 7, 2025

Results:

tests/test_plots.py::TestCalculatePct::test_calculate_pct_basic PASSED                                                                                                                                                                                       [  3%]
tests/test_plots.py::TestCalculatePct::test_calculate_pct_empty PASSED                                                                                                                                                                                       [  7%]
tests/test_plots.py::TestCalculatePct::test_calculate_pct_single PASSED                                                                                                                                                                                      [ 11%]
tests/test_plots.py::TestMergeSmallEntries::test_merge_small_entries_basic PASSED                                                                                                                                                                            [ 15%]
tests/test_plots.py::TestMergeSmallEntries::test_merge_small_entries_no_small PASSED                                                                                                                                                                         [ 19%]
tests/test_plots.py::TestMergeSmallEntries::test_merge_small_entries_some_small PASSED                                                                                                                                                                       [ 23%]
tests/test_scaffolding.py::test_get_time_query PASSED                                                                                                                                                                                                        [ 26%]
tests/test_scaffolding.py::test_mapping_labels PASSED                                                                                                                                                                                                        [ 30%]
tests/test_scaffolding.py::test_mapping_color_surveys PASSED                                                                                                                                                                                                 [ 34%]
tests/test_scaffolding.py::test_mapping_color_surveys_empty PASSED                                                                                                                                                                                           [ 38%]
tests/test_scaffolding.py::test_get_quality_text PASSED                                                                                                                                                                                                      [ 42%]
tests/test_scaffolding.py::test_get_quality_text_include_test_users PASSED                                                                                                                                                                                   [ 46%]
tests/test_scaffolding.py::test_get_quality_text_include_mode_of_interest PASSED                                                                                                                                                                             [ 50%]
tests/test_scaffolding.py::test_get_quality_text_sensed PASSED                                                                                                                                                                                               [ 53%]
tests/test_scaffolding.py::test_get_quality_text_sensed_include_test_users PASSED                                                                                                                                                                            [ 57%]
tests/test_scaffolding.py::test_get_quality_text_numerator PASSED                                                                                                                                                                                            [ 61%]
tests/test_scaffolding.py::test_get_quality_text_numerator_include_test_users PASSED                                                                                                                                                                         [ 65%]
tests/test_scaffolding.py::test_get_file_suffix PASSED                                                                                                                                                                                                       [ 69%]
tests/test_scaffolding.py::test_unit_conversions PASSED                                                                                                                                                                                                      [ 73%]
tests/test_scaffolding.py::test_filter_labeled_trips_with_labeled_trips PASSED                                                                                                                                                                               [ 76%]
tests/test_scaffolding.py::test_filter_labeled_trips_empty_dataframe PASSED                                                                                                                                                                                  [ 80%]
tests/test_scaffolding.py::test_filter_labeled_trips_no_labeled_trips PASSED                                                                                                                                                                                 [ 84%]
tests/test_scaffolding.py::test_expand_userinputs PASSED                                                                                                                                                                                                     [ 88%]
tests/test_scaffolding.py::test_translate_values_to_labels_english PASSED                                                                                                                                                                                    [ 92%]
tests/test_scaffolding.py::test_translate_values_to_labels_spanish SKIPPED (Implementation limited only for english translations)                                                                                                                            [ 96%]
tests/test_scaffolding.py::test_translate_values_to_labels_empty_input PASSED

Coverage Report:

plots.py                                                            303    248    18%
scaffolding.py                                                      345    224    35%

@iantei iantei marked this pull request as ready for review February 7, 2025 17:03
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