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

Tidy up Camera-related tests and add a name property #253

Merged
merged 2 commits into from
Jan 13, 2024

Conversation

mwcraig
Copy link
Contributor

@mwcraig mwcraig commented Jan 11, 2024

My original intent here was to just a dd a name property; that allows storing at least a little information that is human-readable to identify the camera if looking at the settings much later.

Since that would have meant many, many changes to the tests I first rewrote the tests a bit so that Camera only needed to be changed for the new property in one or two places.

I think that ended up making the tests a little bit clearer because it is now more explicit what property of the camera is being changed/modified in a particular ttest.

The goal here was to make it as easy as possible to revise tests if
new camera properties are added by removing duplication.
@mwcraig
Copy link
Contributor Author

mwcraig commented Jan 11, 2024

@JuanCab -- it may be easier to look at the two commits separately. The first commit condenses the tests, the second commit add the name property.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f0c5939) 55.90% compared to head (792fc4d) 55.92%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #253      +/-   ##
==========================================
+ Coverage   55.90%   55.92%   +0.01%     
==========================================
  Files          25       25              
  Lines        2962     2963       +1     
==========================================
+ Hits         1656     1657       +1     
  Misses       1306     1306              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@JuanCab JuanCab left a comment

Choose a reason for hiding this comment

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

It looked good, in fact, I rather like the 'trimming' you have been doing tightening up this code (particularly the testing code). I also like how the test for alt units being ok (test_camera_altunitscheck) is now just to assert the dictionary for the camera is still the same one you used to create it (I assume this is thanks to pydantic's checking).

Copy link
Contributor

Choose a reason for hiding this comment

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

Rather like this approach of having a ZERO_CAMERA and then just copying it and changing the attributes. Cleaner test code!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

😀 thanks!

@mwcraig mwcraig merged commit 61b6ef6 into feder-observatory:main Jan 13, 2024
9 checks passed
@mwcraig mwcraig deleted the more-camera-settings branch January 13, 2024 13:34
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.

3 participants