Centralize managed state targets
This commit is contained in:
@@ -145,16 +145,20 @@ func TestBackendManagedDeletion(t *testing.T) {
|
||||
backend := newBackend(t)
|
||||
mustWrite(t, backend, "bundle/report.html", "html")
|
||||
mustWrite(t, backend, "bundle/keep.txt", "keep")
|
||||
mustWrite(t, backend, "bundle/.distributor.json", "{}")
|
||||
statePath, err := storage.StatePath("bundle")
|
||||
if err != nil {
|
||||
t.Fatalf("StatePath() error = %v", err)
|
||||
}
|
||||
mustWrite(t, backend, statePath, "{}")
|
||||
|
||||
err := backend.DeleteManagedBundle(context.Background(), "bundle", []string{"report.html"}, storage.DeleteOptions{PruneEmptyDirs: true})
|
||||
err = backend.DeleteManagedBundle(context.Background(), "bundle", []string{"report.html"}, storage.DeleteOptions{PruneEmptyDirs: true})
|
||||
if err != nil {
|
||||
t.Fatalf("DeleteManagedBundle() error = %v", err)
|
||||
}
|
||||
if _, err := backend.Stat(context.Background(), "bundle/report.html"); !storage.IsNotFound(err) {
|
||||
t.Fatalf("managed output stat error = %v, want not found", err)
|
||||
}
|
||||
if _, err := backend.Stat(context.Background(), "bundle/.distributor.json"); !storage.IsNotFound(err) {
|
||||
if _, err := backend.Stat(context.Background(), statePath); !storage.IsNotFound(err) {
|
||||
t.Fatalf("state stat error = %v, want not found", err)
|
||||
}
|
||||
if _, err := backend.Stat(context.Background(), "bundle/keep.txt"); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user