Skip to content

Commit

Permalink
Add test for uploading with relative paths
Browse files Browse the repository at this point in the history
  • Loading branch information
jtsmedley committed Sep 17, 2024
1 parent ec4f39a commit fc525e6
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/objectManager.spec.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,38 @@ test("upload directory", async () => {
}
});

test("upload directory relative paths", async () => {
// Create Bucket `create-object-test-pass
const uploadDirectoryTestBucket = `${TEST_PREFIX}-create-directory-relative-test-pass`;
await createBucket(uploadDirectoryTestBucket);

try {
// Upload object `create-object-test`
const uploaded = await uploadObject(
uploadDirectoryTestBucket,
`create-directory-relative-test`,
[
{
path: "testObjects/1.txt",
content: Buffer.from("upload test object", "utf-8"),
},
{
path: "testObjects/deep/1.txt",
content: Buffer.from("upload deep test object", "utf-8"),
},
{
path: "topLevel.txt",
content: Buffer.from("upload top level test object", "utf-8"),
},
],
);
assert.strictEqual(uploaded, true);
await deleteObject(uploadDirectoryTestBucket, `create-directory-relative-test`);
} finally {
await deleteBucket(uploadDirectoryTestBucket);
}
});

test("download object", async () => {
// Create bucket `download-object-test-pass`
const downloadTestBucket = `${TEST_PREFIX}-download-object-test-pass`;
Expand Down

0 comments on commit fc525e6

Please sign in to comment.