Skip to content

Conversation

@albertsola
Copy link
Contributor

No description provided.

@albertsola albertsola force-pushed the e2e/catalog/MPT-14890-tests-for-product-media branch from c9c7f2a to 1375b24 Compare November 19, 2025 11:59
@github-actions
Copy link

github-actions bot commented Nov 19, 2025

✅ Found Jira issue key in the title: MPT-14890

Generated by 🚫 dangerJS against 1751a85

@albertsola albertsola force-pushed the e2e/catalog/MPT-14890-tests-for-product-media branch from 1375b24 to 1ac1861 Compare November 19, 2025 13:26

from mpt_api_client.constants import APPLICATION_JSON
from mpt_api_client.exceptions import MPTError, transform_http_status_exception
from mpt_api_client.http.mixins import _json_to_file_payload
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we importing a private method here? I wonder why the PLC2701 wasn't raised by the linter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, we are moving that functionality from mixins to client. Temporary is in both places.

I have moved it to the http.client now.

@robcsegal will refactor the rest of the mixins to remove that dependency.



def _json_to_file_payload(resource_data: ResourceData) -> bytes:
def _json_to_file_payload(resource_data: ResourceData | None) -> bytes:
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we have this private method outside of the class? I believe the responsibility for that belongs to the FilesOperationsMixin. If you don't want to duplicate the code you should add a parent class with this method, so it can be inherited by the Async and sync mixins. Or, you can duplicate the code to keep the sync and async logic separated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are removing FilesOperationMixin, we are moving all files handling logic into the http.client.
Otherwise each request with a file upload is a copy of FilesOperationMixin with subsequent unit tests.

@albertsola albertsola force-pushed the e2e/catalog/MPT-14890-tests-for-product-media branch from 1ac1861 to 635f194 Compare November 19, 2025 15:25
@albertsola albertsola force-pushed the e2e/catalog/MPT-14890-tests-for-product-media branch from 635f194 to 1751a85 Compare November 19, 2025 15:39
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
7.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@d3rky d3rky merged commit edd37a2 into main Nov 19, 2025
3 of 4 checks passed
@d3rky d3rky deleted the e2e/catalog/MPT-14890-tests-for-product-media branch November 19, 2025 16:14
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.

5 participants