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

1361 create upload an download endpoint for storedfiles #1395

Merged

Conversation

raduiordache
Copy link
Collaborator

@raduiordache raduiordache commented Feb 16, 2024

Fixes #

Checklist:

  • My code follows the pykechain style
    • I added type hinting to all functions
    • I added documentation for all public functions
    • I locally used tox to check for dists and docs errors
    • My code passes the pep8 and flake8 linting checks and no warnings
    • I removed unused imports, using Code > Optimize Imports in PyCharm
    • I used black to format the new code
  • I have added tests that prove my fix is effective or that my feature works
    • I committed fresh test cassettes
    • I have proper test coverage (don't decline the coverage of the test)
  • I asked another teammate to review the code
  • I update the Changelog.md with the appropriate changes.

@raduiordache raduiordache linked an issue Feb 16, 2024 that may be closed by this pull request
The commit added two new methods to the StoredFilesReferencesProperty class. The 'clear' method allows clearing stored files from the property's value, minimizing the effect when converting from AttachmentProperty to StoredFileReferenceProperty. The 'filename' method provides the filename of the file stored in the property. Tests were updated accordingly.
Additional functionality added to StoredFile and StoredFilesReferencesProperty. The filename property has been added to StoredFile based on the basename of the file url. StoredFilesReferencesProperty received new filename, upload, and clear methods. Various functions and methods have been modified to utilize the new filename functionality, and corresponding tests have been updated or added to confirm correct functionality.
…storedfiles

# Conflicts:
#	pykechain/utils.py
The test file 'TestDownloadStoredFiles.test_download_image_from_stored_file.json' has been removed. This is because the StoredFiles and StoredFilesReferencesProperty functionality has been updated, rendering this particular test case obsolete.
This commit introduces the ability to download, upload, and reference `StoredFiles`. It also includes functions for effectively managing `StoredFileReferenceProperty`. Subsequently, redundant test files related to downloading images from `StoredFiles` have been removed.
This commit removes the now redundant JSON test file for uploading plot files to `StoredFiles`. This change is in line with the recent implementation of new handling for `StoredFiles` which includes efficient management of `StoredFileReferenceProperty`.
This test file was removed because it is no longer needed after the implementation of improved handling for StoredFiles. The updates to StoredFiles now allow for more efficient management of StoredFileReferenceProperty, making this test file obsolete.
Docstrings in 'stored_file.py', 'utils.py', and 'property_reference.py' files have been modified to provide clearer explanations. Extra lines were removed to deliver information more concisely and periods were added where they were missing. The original intent of the docstrings is preserved while improving readability.
pykechain/models/property_reference.py Outdated Show resolved Hide resolved
pykechain/models/property_reference.py Outdated Show resolved Hide resolved
pykechain/utils.py Outdated Show resolved Hide resolved
jberends and others added 5 commits March 5, 2024 13:09
This modification introduces default matching options for requests in Betamax's setup in the tests/classes.py file. The newly added options include 'method' and 'uri', increasing precision on requests matching. In addition, the placeholder for "STORED_FILE_CDN_URL" was defined.
Configured test cassette options in Betamax setup for better test accuracy. The default matching options, 'method' and 'uri', have been included for more precise request matching. Additionally, a placeholder for "STORED_FILE_CDN_URL" was defined.
This update modifies the Betamax config in tests/classes.py to provide more clarity. Specifically, the default cassette options for 'method' and 'uri' have been reorganized for easier reading. Additionally, the placeholder for "STORED_FILE_CDN_URL" has been defined in the setup.
Refactored test cases by creating a base test case for StoredFiles. Specific test cases for Download and Upload now inherit from this base case. Some test cases have been marked to be skipped when running in continuous integration environments such as Travis or Github Actions due to access key restrictions on stored file download links.
@raduiordache raduiordache merged commit c24fc61 into main Mar 5, 2024
9 checks passed
@raduiordache raduiordache deleted the 1361-create-upload-an-download-endpoint-for-storedfiles branch March 5, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Create upload an download endpoint for Storedfiles
3 participants