From d779bd881a2c19963084a090b6d8715efc84e9eb Mon Sep 17 00:00:00 2001 From: Arnaud Date: Thu, 9 Oct 2025 05:30:19 +0200 Subject: [PATCH] Storage delete tests --- codex/storage_test.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/codex/storage_test.go b/codex/storage_test.go index 38296b1..f002bb2 100644 --- a/codex/storage_test.go +++ b/codex/storage_test.go @@ -91,3 +91,31 @@ func TestFetchCidDoesNotExist(t *testing.T) { t.Fatal("expected error when fetching non-existent manifest") } } + +func TestDelete(t *testing.T) { + codex := newCodexNode(t) + + cid, _ := uploadHelper(t, codex) + + manifests, err := codex.Manifests() + if err != nil { + t.Fatal(err) + } + if len(manifests) != 1 { + t.Fatal("expected manifests to be empty after deletion") + } + + err = codex.Delete(cid) + if err != nil { + t.Fatal(err) + } + + manifests, err = codex.Manifests() + if err != nil { + t.Fatal(err) + } + + if len(manifests) != 0 { + t.Fatal("expected manifests to be empty after deletion") + } +}