sqlalchemy-media
sqlalchemy-media copied to clipboard
Update code to ensure tests pass correctly in more modern verisons of python
This PR attempts to fix the unit tests in the cleanest way possible with minimal changes to existing functionality.
Changes include:
- sqlite databases used for tests are now saved to the output directory with the generated images (instead of in-memory) to allow failed tests to be more easily debugged
- some fixes were made to attachments.py to correct an issue where thumbnails were not being correctly saved to an
Imageobject, causing test failures (fixes #133) - more assertions were added to better detect the previous issue
- some tweaks were mane to the Image unit tests to ensure that objects from the previous session weren't being reused in a new session (seemingly intended to simulate retrieval from the DB at a later time) and causing sqlalchemy to crash
- small tweaks to variable names in image tests to make the intention clearer and prevent potential issues with variable shadowing
- corrected typos in file and class naming for the
GoogleCloudStorageclass to allow the test to properly load - updated mocks and the file paths to the
stuff/cat.jpgimage inGoogleCloudStoragetests so the tests actually run