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

25 make unit tests less brittle by dynamically naming mocker patch locations #29

Conversation

asgibson
Copy link
Contributor

Updated all tests to use the <import "as" named item>.__name__ in the mocker.patch calls.
Also standardized the imports in the test files.
Removed some unused files from the test directory (from the data dir, left the dir but no files).
Renamed test_brain.py to test_agent.py to reflect src code filename.
Renamed test_spacecraft to test_vehicle_rep to reflect src code filename.

All patches using imported 'as' names
Standardized import usage
  testing framework imports
  empty line
  tested code imports
  empty line,
  supporting code imports
Removed any unused imports EXCEPT pytest
  pytest was left even if unused
  rationale: we don't want any test updates breaking due to it missing
@asgibson asgibson added the unit test Unit tests need fixed or added label Aug 31, 2023
@asgibson asgibson added this to the OnAIR 1.0 refactor milestone Aug 31, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #29 (ac8f319) into main (7fceac2) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##              main       #29   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           25        25           
  Lines         1164      1164           
  Branches       155       155           
=========================================
  Hits          1164      1164           

Copy link
Contributor

@the-other-james the-other-james left a comment

Choose a reason for hiding this comment

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

Looks good! Tests ran fine on my machine.

@asgibson asgibson merged commit 7552b33 into main Aug 31, 2023
2 checks passed
@asgibson asgibson deleted the 25-make-unit-tests-less-brittle-by-dynamically-naming-mockerpatch-locations branch August 31, 2023 19:56
the-other-james pushed a commit to dennisafa/OnAIR that referenced this pull request Feb 23, 2024
…ass-aka-telemetry_test_suite-py-to-100' into 'main'

Updates for testing telemetry_test_suite.py

Closes nasa#29

See merge request cFS_lab/raisr_nos3/raisr-2.0!15
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unit test Unit tests need fixed or added
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make unit tests less brittle by dynamically naming mocker.patch locations
4 participants