|
1 | | -package internxt_test |
| 1 | +package internxt |
2 | 2 |
|
3 | 3 | import ( |
| 4 | + "context" |
| 5 | + "errors" |
4 | 6 | "testing" |
5 | 7 |
|
6 | | - "github.com/rclone/rclone/backend/internxt" |
| 8 | + "github.com/rclone/rclone/fs" |
| 9 | + "github.com/rclone/rclone/fs/operations" |
| 10 | + "github.com/rclone/rclone/fstest" |
7 | 11 | "github.com/rclone/rclone/fstest/fstests" |
| 12 | + "github.com/stretchr/testify/require" |
8 | 13 | ) |
9 | 14 |
|
10 | 15 | func TestIntegration(t *testing.T) { |
11 | 16 | fstests.Run(t, &fstests.Opt{ |
12 | 17 | RemoteName: "TestInternxt:", |
13 | | - NilObject: (*internxt.Object)(nil), |
| 18 | + NilObject: (*Object)(nil), |
14 | 19 | }) |
15 | 20 | } |
| 21 | + |
| 22 | +// TestMakeDir verifies that basic operations (such as mkdir) can be performed |
| 23 | +func TestMakeDir(t *testing.T) { |
| 24 | + const ( |
| 25 | + remoteName = "TestInternxt:" |
| 26 | + ) |
| 27 | + ctx := context.Background() |
| 28 | + fstest.Initialise() |
| 29 | + subRemoteName, _, err := fstest.RandomRemoteName(remoteName) |
| 30 | + require.NoError(t, err) |
| 31 | + f, err := fs.NewFs(ctx, subRemoteName) |
| 32 | + if errors.Is(err, fs.ErrorNotFoundInConfigFile) { |
| 33 | + t.Logf("Didn't find %q in config file - skipping tests", remoteName) |
| 34 | + return |
| 35 | + } |
| 36 | + require.NoError(t, err) |
| 37 | + |
| 38 | + entr, err := f.List(ctx, "") |
| 39 | + t.Log(entr) |
| 40 | + require.NoError(t, err) |
| 41 | + |
| 42 | + err = f.Mkdir(ctx, "hello-integration-test") |
| 43 | + require.NoError(t, err) |
| 44 | + |
| 45 | + // Tear down |
| 46 | + require.NoError(t, operations.Purge(ctx, f, "")) |
| 47 | +} |
0 commit comments