Commit Graph

13 Commits

Author SHA1 Message Date
Philipp Wolfer
c0e6243a13 PICARD-1926: Adjust test cases for new config structure 2020-12-25 12:37:15 +01:00
Philipp Wolfer
fb83a8e76b Enable flake8 E265: Block comment should start with '# '
Most changes involve replacing non-breaking space with a simple space after the #.
2020-05-13 11:03:13 +02:00
Laurent Monin
6b5e852a60 Run fix-header on *.py 2020-02-24 10:25:09 +01:00
Philipp Wolfer
7e350da299 Refactor File to handle acoustid_fingerprint
acoustid_fingerprint is now a normal attribute of File and always available. Adding and removing the file to and from the AcoustIDManager is now completely handled in File.
2020-02-20 07:29:51 +00:00
Laurent Monin
498c8eab1b Add mktmpdir method to PicardTestCase, and use it more widely 2020-02-08 18:04:39 +01:00
Laurent Monin
b7389a6445 Tests: ensure temporary directories and files are removed after tests
- QSettings object needs special care, as file was re-created on exit
- Append a cleanup function as soon as possible to ensure temporary dirs & files are removed in any case
- prefer addCleanup() over tearDown(), keeping creation and cleanup together
2020-02-08 18:04:39 +01:00
Philipp Wolfer
7c6929286b Apply utime test workaround for all macOS versions.
This also seems not only on the macOS version but also on the Python build being used. On the build server with macOS 10.15 this works with the Python binaries provided on the server, but fails with official binaries from python.org.
2020-02-06 19:55:42 +01:00
Philipp Wolfer
157d3cfc97 Fixed file naming tests on Windows 2019-08-07 08:47:22 +02:00
Philipp Wolfer
9d67a45bde Added tests for File.make_filename 2019-08-05 19:32:47 +02:00
Philipp Wolfer
f4d27d1fcc PICARD-1561: On macOS 10.14 test preserve time only with second accuracy 2019-07-23 10:08:26 +02:00
Laurent Monin
a9cf9d55c8 File._preserve_times(): fix broken logic
- access times are likely to differ, a race condition is possible
- stat() has be done after the change to be able to compare
- comments added
- force sync after modifying test file
- make code easier to understand

See https://github.com/metabrainz/picard/pull/1132#issuecomment-474113665
2019-03-19 23:21:59 +01:00
Laurent Monin
6a63c3e5be Improve file times preservation using os.utime() ns parameter (py >= 3.3)
https://docs.python.org/3/library/os.html#os.utime
Since Python 3.3, ns parameter is available
"The best way to preserve exact times is to use the st_atime_ns and st_mtime_ns
fields from the os.stat() result object with the ns parameter to utime."

Make time preservation testable.
2019-03-14 10:57:55 +01:00
Philipp Wolfer
68d5bb3b33 PICARD-1341: Fix cluster sorting by disc and track number 2018-11-25 11:17:22 +01:00