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

Initial unit testing for scaffolding file Part 0 #174

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

Conversation

iantei
Copy link
Contributor

@iantei iantei commented Nov 12, 2024

  • Executes all the unit test cases present inside tests directory
  • Test cases to test mapping_labels and get_time_query functions in scaffolding.py

…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
@iantei iantei changed the base branch from main to fix_start_notebook_path November 12, 2024 16:57
@iantei iantei changed the base branch from fix_start_notebook_path to main November 12, 2024 16:57
@iantei
Copy link
Contributor Author

iantei commented Nov 18, 2024

Testing:

notebook-server-1  | test_plots.py::TestCalculatePct::test_calculate_pct_empty PASSED         [ 25%]
notebook-server-1  | test_plots.py::TestCalculatePct::test_calculate_pct_single PASSED        [ 37%]
notebook-server-1  | test_plots.py::TestMergeSmallEntries::test_merge_small_entries_basic PASSED [ 50%]
notebook-server-1  | test_plots.py::TestMergeSmallEntries::test_merge_small_entries_no_small PASSED [ 62%]
notebook-server-1  | test_plots.py::TestMergeSmallEntries::test_merge_small_entries_some_small PASSED [ 75%]
notebook-server-1  | test_scaffolding.py::test_get_time_query PASSED                          [ 87%]
notebook-server-1  | test_scaffolding.py::test_mapping_labels PASSED                          [100%]

notebook-server-1  | /usr/src/app/saved-notebooks/plots.py                               303    248    18%
notebook-server-1  | /usr/src/app/saved-notebooks/scaffolding.py                         345    277    20%

@iantei iantei marked this pull request as ready for review November 18, 2024 19:25
…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 Initial unit testing for scaffolding file Initial unit testing for scaffolding file Part 0 Dec 5, 2024
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.

1 participant