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
```
This commit is contained in:
Stefano Rivera 2025-11-23 13:50:57 -04:00
parent d446e10fb0
commit 4a17901c1d

View file

@ -579,7 +579,7 @@ class SafeMoveCopyTest(FilePathTestCase):
@NEEDS_REFLINK
def test_successful_reflink(self):
util.reflink(self.path, self.dest)
util.reflink(str(self.path), str(self.dest))
assert self.dest.exists()
assert self.path.exists()