1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00

mockfs: make it so it can be registered as an Fs

This commit is contained in:
Nick Craig-Wood
2023-04-28 12:01:04 +01:00
parent 335ca6d572
commit 6b670bd439
7 changed files with 40 additions and 12 deletions

View File

@@ -193,7 +193,9 @@ func TestFileOpenReadUnknownSize(t *testing.T) {
assert.Equal(t, int64(-1), o.Size())
// add it to a mock fs
f := mockfs.NewFs(context.Background(), "test", "root")
fMock, err := mockfs.NewFs(context.Background(), "test", "root", nil)
require.NoError(t, err)
f := fMock.(*mockfs.Fs)
f.AddObject(o)
testObj, err := f.NewObject(ctx, remote)
require.NoError(t, err)