quipucords / camayoc

Test automation framework that facilitates functional testing of quipucords.
https://camayoc.readthedocs.io/
GNU General Public License v3.0
5 stars 4 forks source link

Drop config.get_config backwards compatibility shim #492

Closed mirekdlugosz closed 6 months ago

mirekdlugosz commented 6 months ago

Remove old backwards compatibility shim and using configuration as dictionary, embrace strongly-typed settings.

The main change is that API client can be provided settings objects as parameter. This greatly simplifies unit tests.

Also - configuration fields like hostname are required and this condition is checked by pydantic when creating the object. We don't need to check if hostname is available when constructing the client - if we get that far, it means we do have hostname.

I took a bit of debt in camayoc/tests/qpc/api/v1/utils.py - the function in question is effectively replaced by data provider, but is never invoked for now as tests that use it are marked as skipped.

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 83.33333% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 77.24%. Comparing base (c6771b7) to head (e1f3e4b).

Files Patch % Lines
camayoc/api.py 77.77% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #492 +/- ## ========================================== - Coverage 77.55% 77.24% -0.31% ========================================== Files 7 7 Lines 637 624 -13 ========================================== - Hits 494 482 -12 + Misses 143 142 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.