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
Jacob Gillespie
902b955696
Fix test_hardlink_arrives
2017-02-19 17:22:01 -06:00
Jacob Gillespie
b4efecb709
Add option to hardlink when importing
2017-02-19 15:56:13 -06:00
Adrian Sampson
a88682e7bb
Undo from _common import unittest indirection
...
This was a vestige from when we used to need the unittest2 library for pre-2.7
compatibility. Now that we require Python 2.7, we aren't using that library
and this indirection wasn't doing any good.
2016-11-26 18:46:44 -05:00
Johnny Robeson
ffa46a185c
bytestring normalization
...
Make sure many/most strings that touch the filesystem are
converted explicitly to bytestrings rather than implictly.
2016-06-13 05:39:09 -04:00
Adrian Sampson
71b9fd785c
Revert "Do __name__ comparison with bytes and not unicode"
...
This reverts commit 9c41c39913 .
That commit used byte strings for the `if __name__ == '__main__'` pattern,
which was necessary when we were doing unicode_literals. But it is wrong on
Python 3, and now that we're liberated from unicode_literals, we need to go
back to native strings for this comparison.
2016-05-29 19:19:59 -07:00
Johnny Robeson
c330f3abc3
replace deprecated assert_() with assertTrue()
2016-05-29 03:56:39 -04:00
Johnny Robeson
7f41d5c188
use 0o prefix when we want octal
2016-05-26 22:31:55 -04:00
Adrian Sampson
e54c7eec3d
Standardize __future__ imports without parentheses
...
Since the list is short enough now, we don't need parentheses for the line
wrap. This is a little less ugly.
2016-02-28 15:03:51 -08:00
Peter Kessen
0fececde4c
Removed unicode_literals from test_files
2016-02-22 16:32:36 +01:00
Jack Wilsdon
12cd5306b7
Update copyright dates to 2016
2015-12-30 15:42:06 +00:00
Peter Kessen
3eb8008b11
added encoding as comment in files
...
added line like
# -*- coding: utf-8 -*-
to all files with correct license in header
2015-11-19 18:41:01 +01:00
Adrian Sampson
ba87ea1f30
Skip symlink tests on Windows
...
... where there is no symlinking.
2015-04-23 17:43:15 -07:00