Commit adf85c59 authored by Leon's avatar Leon
Browse files

fix: new test storage has 1 log standard, print more detailed test failure

parent fcb0bdc8
Pipeline #39626 passed with stages
in 3 minutes and 28 seconds
...@@ -3,6 +3,7 @@ package irmaclient ...@@ -3,6 +3,7 @@ package irmaclient
import ( import (
"encoding/json" "encoding/json"
"errors" "errors"
"fmt"
"os" "os"
"path/filepath" "path/filepath"
"testing" "testing"
...@@ -366,20 +367,20 @@ func TestRemoveStorage(t *testing.T) { ...@@ -366,20 +367,20 @@ func TestRemoveStorage(t *testing.T) {
client := parseStorage(t) client := parseStorage(t)
defer test.ClearTestStorage(t) defer test.ClearTestStorage(t)
bucketsBefore := map[string]bool{"attrs": true, "sigs": true, "userdata": true, "logs": false} // Test storage has no logs bucketsBefore := map[string]bool{"attrs": true, "sigs": true, "userdata": true, "logs": true} // Test storage has 1 log
bucketsAfter := map[string]bool{"attrs": false, "sigs": false, "userdata": true, "logs": false} // Userdata should hold a new secret key bucketsAfter := map[string]bool{"attrs": false, "sigs": false, "userdata": true, "logs": false} // Userdata should hold a new secret key
old_sk := *client.secretkey old_sk := *client.secretkey
// Check that buckets exist // Check that buckets exist
for name, exists := range bucketsBefore { for name, exists := range bucketsBefore {
require.Equal(t, exists, client.storage.BucketExists([]byte(name))) require.Equal(t, exists, client.storage.BucketExists([]byte(name)), fmt.Sprintf("Bucket \"%s\" exists should be %t", name, exists))
} }
require.NoError(t, client.RemoveStorage()) require.NoError(t, client.RemoveStorage())
for name, exists := range bucketsAfter { for name, exists := range bucketsAfter {
require.Equal(t, exists, client.storage.BucketExists([]byte(name))) require.Equal(t, exists, client.storage.BucketExists([]byte(name)), fmt.Sprintf("Bucket \"%s\" exists should be %t", name, exists))
} }
// Check that the client has a new secret key // Check that the client has a new secret key
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment