Šarūnas Nejus
b2f52ac124
Remove syspath
2026-07-30 12:18:49 +01:00
Šarūnas Nejus
951e32a852
Use pathlib.Path wherever possible in tests
2026-07-30 12:18:49 +01:00
Šarūnas Nejus
04c2304879
Replace item.path with item.filepath in tests
2026-07-30 12:18:49 +01:00
Šarūnas Nejus
d24c0d341e
Rename PathsMixin.temp_dir_path to PathsMixin.temp_path for consistency
2026-07-21 11:15:25 +01:00
Šarūnas Nejus
2e9ace7b20
Replace PathsMixin.temp_dir attribute with PathsMixin.temp_dir_path
2026-07-21 11:15:25 +01:00
Šarūnas Nejus
dc2826fa4b
Replace TestHelper.libdir attribute with TestHelper.lib_path
2026-07-21 11:15:25 +01:00
Šarūnas Nejus
b1ae461723
Rip out util tests from test_files
2026-06-30 21:39:34 +01:00
Sebastian Mohr
54a2bd20e1
Removed This file is part of beets... headers.
2026-06-29 11:20:15 +02:00
Šarūnas Nejus
2f326b6bdb
Remove old cover art instead of keeping it
2026-04-21 22:09:38 +01:00
Šarūnas Nejus
9e48d9b16a
Reproduce the issue
2026-04-21 22:09:38 +01:00
Šarūnas Nejus
a2cb160064
Store item paths relative to library directory
...
Convert item paths to relative on write and back to absolute on read,
keeping the database free of hardcoded library directory. Fix tests to
account for absolute path return values.
2026-04-11 13:01:41 +01:00
Dmitri Vassilenko
df7db24871
Fix symlink tests for macOS
2026-03-02 09:24:25 +00:00
Stefano Rivera
4a17901c1d
reflink() doesn't take Path parameters
...
Fix `test_successful_reflink`, by passing the right kinds of parameters.
This was failing inside the reflink package:
```
/usr/lib/python3/dist-packages/reflink/reflink.py:34: in reflink
backend.clone(oldpath, newpath)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
oldpath = PosixPath('/tmp/tmpx3jirmhp/testfile')
newpath = PosixPath('/tmp/tmpx3jirmhp/testfile.dest')
def clone(oldpath, newpath):
if isinstance(oldpath, unicode):
oldpath = oldpath.encode(sys.getfilesystemencoding())
if isinstance(newpath, unicode):
newpath = newpath.encode(sys.getfilesystemencoding())
> newpath_c = ffi.new('char[]', newpath)
^^^^^^^^^^^^^^^^^^^^^^^^^^
E TypeError: expected new array length or list/tuple/str, not PosixPath
```
2025-11-23 13:50:57 -04:00
Emi Katagiri-Simpson
19665cd8cf
Merge remote-tracking branch 'upstream/master' into dereference-symlinks-while-hardlinking
2025-10-28 17:13:51 -04:00
Šarūnas Nejus
43b8cce063
Replace assertIsDir
2025-07-09 09:21:50 +01:00
Šarūnas Nejus
c706f62fb2
Replace assertExists in test_files
2025-07-09 09:21:48 +01:00
Šarūnas Nejus
e40c7fd71c
Introduce Album.art_filepath to simplify existence checks
2025-07-09 09:21:47 +01:00
Šarūnas Nejus
c9f98fca55
Use unittest.TestCase for tests that don't require the dir setup
2025-05-26 12:40:38 +01:00
Emi Katagiri-Simpson
7acf2b3acf
Dereference symlinks before hardlinking
...
(see #5676 )
2025-03-22 23:15:45 -04:00
Šarūnas Nejus
851699ab76
Clarify test_unsuccessful_reflink error message
2024-09-05 04:32:13 +01:00
Šarūnas Nejus
fee959c500
Handle missing reflink dependency in the business logic
2024-09-04 20:34:00 +01:00
Šarūnas Nejus
4f3b0faba5
Handle missing reflink dependency in tests
2024-09-04 19:06:55 +01:00
Šarūnas Nejus
f9359df0d1
Replace assertNotEqual
2024-08-12 08:43:42 +01:00
Šarūnas Nejus
847e3858a6
Replace assertRaises
2024-08-12 08:43:42 +01:00
Šarūnas Nejus
9a05d27acf
Replace assertEqual
2024-08-12 08:43:42 +01:00
Šarūnas Nejus
6631b6aef6
Replace assertNotIn
2024-08-12 08:43:42 +01:00
Šarūnas Nejus
11e948121c
Replace assertIn
2024-08-12 08:43:42 +01:00
Šarūnas Nejus
5d4911e905
Replace assertIsNone
2024-08-12 08:43:41 +01:00
Šarūnas Nejus
0ecc345143
Replace assertTrue
2024-08-05 17:11:16 +01:00
Šarūnas Nejus
fcff5d72af
Remove def suite TestLoader definitions
2024-07-28 18:58:51 +01:00
Šarūnas Nejus
7d7f16395c
Remove redundant library setUp instructions
2024-07-28 18:58:34 +01:00
Šarūnas Nejus
3e278159ed
Dedupe TestHelper and _common.TestCase setup
2024-07-28 18:58:33 +01:00
Kirill A. Korinsky
938628b094
Add missed HAVE_REFLINK in test_files.py
2024-05-30 14:09:37 +02:00
freddiewanah
e0de6e1b89
refactor the test methods to avoid suboptimal asserts.
2024-04-08 21:39:25 +08:00
freddiewanah
3045550368
remove redundant prints
2024-04-08 19:14:42 +08:00
Lars Kruse
508d28f66b
tests: move reusable test-related modules into the beets package
...
External Python packages interfacing beets may want to use an in-memory
beets library instance for testing beets-related code.
The `TestHelper` class is very helpful for this purpose.
Previously `TestHelper` was located in the `test/` directory.
Now it is part of `beets` itself (`beets.test.helper.TestHelper`) and
can be easily imported.
2024-01-15 19:40:57 +01:00
Serene-Arc
a6e5201ff3
Apply formatting tools to all files
...
This is 'the big one', which touches every file so that it all conforms
to the given standard.
2023-10-22 09:53:18 +10:00
wisp3rwind
9af9eb9b31
tests: make use of our custom filesystem assertions for conciseness
...
this replaces assertions of the form
self.assertTrue(os.path.exists(syspath(path)))
by
self.assertExists(path)
which includes the syspath conversion and is much easier to read.
Occurences where located using
git grep -E 'assert(True|False).*(isdir|isfile|exist)'
2023-07-16 10:42:47 +02:00
wisp3rwind
1ef6b90786
add missing syspath conversions (1/3, tests)
...
these are mostly in the tests, which didn't cause issues since the
affected directories usually have nice ASCII paths. For consistency, it
is nicer to always invoke syspath. That also avoids deprecation warnings
for the bytestring interfaces on Python <= 3.5. The bytestring
interfaces were undeprecated with PEP 529 in Python 3.6, such that we
didn't observe any actual failures.
2023-06-24 14:52:46 +02:00
Andrew Rogl
1ec87a3bdd
pyupgrade beetsplug and tests
...
All tests working
More tidy up to be done
2021-08-26 19:12:51 +10:00
Adrian Sampson
9657919968
Merge pull request #3088 from rubdos/reflink
...
Add reflink option
2020-11-27 13:29:10 -05:00
Gunther Schmidl
1eda0d39e6
better regex for drive letter; hopefully fixed tests for 2.7; added test to show only drive-letter like colons are affected
2020-07-25 22:11:07 +02:00
Gunther Schmidl
0a9a801b05
add unit tests
2020-07-25 21:50:33 +02:00
Ruben De Smet
5e2856ef87
Add reflink routine
2020-07-22 18:00:25 +02:00
MartyLake
fb96660171
Review: simpler implementation and test
...
Because **all** the path are bytestrings
2019-07-24 18:09:54 +02:00
MartyLake
076a82daa6
Review: Rename method
2019-07-24 00:09:52 +02:00
MartyLake
68ccfe0e6c
Review: Add missing blank line
2019-07-23 23:54:54 +02:00
MartyLake
d1ba309f36
Add a new method that copied pathlib.path.as_posix
2019-07-23 17:17:40 +02:00
zigarrre
b376139663
Refactored move functions for clarity according to #2682
...
The move functions in library.py and manipule_files in importer.py where
changed to use a single parameter for the file operation instead of
multiple boolean flags.
A typo in the documentation of the Album.move and Item.move functions
confusing True and False when describing the store parameter was fixed
as well.
2017-09-11 17:03:44 +02:00
Jacob Gillespie
1fd22604fb
Fix linter issues
2017-02-19 17:33:26 -06:00