-
Notifications
You must be signed in to change notification settings - Fork 0
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
Prevent file extension and content type mismatch #82
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #82 +/- ##
===========================================
+ Coverage 98.89% 99.30% +0.41%
===========================================
Files 21 19 -2
Lines 453 434 -19
===========================================
- Hits 448 431 -17
+ Misses 5 3 -2 ☔ View full report in Codecov by Sentry. |
ce21dd1
to
17387e8
Compare
17387e8
to
9e3d72c
Compare
9e3d72c
to
85efdeb
Compare
2046bd5
to
716c6bf
Compare
7a81600
to
4051351
Compare
4051351
to
9825c64
Compare
One other thing could you perhaps update the names of this PR and the issue to reflect its new purpose of preventing invalid files/add the issue to the IMS project board please, just helps us find things again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, some very minor changes!
""" | ||
Mocks repo & store methods appropriately to test the `create` service method. | ||
|
||
:param image_post_metadata_data: Dictionary containing the image metadata data as would be required for an | ||
`ImagePostMetadataSchema`. | ||
:filename: Filename of the image. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:filename: Filename of the image. | |
:param filename: Filename of the image. |
Class the `ImageService` `update` method with the appropriate data from a prior call to `mock_update`. | ||
while expecting an error to be raised. | ||
|
||
:param error_type: Expected exception to be raised. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Class the `ImageService` `update` method with the appropriate data from a prior call to `mock_update`. | |
while expecting an error to be raised. | |
:param error_type: Expected exception to be raised. | |
Class the `ImageService` `update` method with the appropriate data from a prior call to `mock_update`, | |
while expecting an error to be raised. | |
:param image_id: ID of the image to be updated. | |
:param error_type: Expected exception to be raised. |
@@ -356,6 +394,20 @@ def test_update_primary(self): | |||
self.call_update(image_id) | |||
self.check_update_success() | |||
|
|||
def test_update_with_file_extension_content_type_mismatch(self): | |||
"""Test updating filename to a mismatched file extension.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"""Test updating filename to a mismatched file extension.""" | |
"""Test updating filename to one with a mismatched file extension.""" |
This is also an issue on the attachments side - I have created an issue for it #96 |
Description
See #81 Implements Option 3 (Store File Extension w/ Filename) Makes Changes to the edit service layer, to ensure that file extension is preserved.
Testing instructions
Add a set up instructions describing how the reviewer should test the code
Agile board tracking
closes #81