Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python Admin SDK Fixes #4423

Closed
Closed
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -428,4 +428,39 @@ describe("GCS endpoint conformance tests", () => {
});
});
});

describe("Delete protocols", () => {
describe("delete objects", () => {
it("should delete objects in the provided bucket", async () => {
const pathPatterns = [
`/b/${storageBucket}/o/${TEST_FILE_NAME}`,
`/storage/v1/b/${storageBucket}/o/${TEST_FILE_NAME}`,
];

for (const deletePathPattern of pathPatterns) {
await supertest(storageHost)
.post(`/upload/storage/v1/b/${storageBucket}/o?name=${TEST_FILE_NAME}`)
.set(authHeader)
.send(Buffer.from("hello world"))
.expect(200);

let data = await supertest(storageHost)
.get(`/storage/v1/b/${storageBucket}/o`)
.set(authHeader)
.expect(200)
.then((res) => res.body);
expect(data.items.length).to.equal(1);

await supertest(storageHost).delete(deletePathPattern).set(authHeader).expect(204);

data = await supertest(storageHost)
.get(`/storage/v1/b/${storageBucket}/o`)
.set(authHeader)
.expect(200)
.then((res) => res.body);
expect(data.items.length).to.equal(0);
}
});
});
});
});