Skip to content

Commit

Permalink
checkMetadata_test: fix a bug related to undeterministic order of keys
Browse files Browse the repository at this point in the history
  • Loading branch information
consolethinks committed Jul 30, 2024
1 parent 436d3f8 commit 50463a4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions datasetIngestor/checkMetadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package datasetIngestor
import (
"net/http"
"reflect"
"strings"
"testing"
"time"
)
Expand Down Expand Up @@ -156,9 +157,10 @@ func TestCheckMetadata_CrashCase(t *testing.T) {
_, _, _, err := CheckMetadata(client, APIServer, metadatafile3, user, accessGroups)

// Check that the function returned the expected error
// TODO: maybe later check the list of illegal keys
if err == nil {
t.Fatal("Function did not return an error as expected")
} else if err.Error() != ErrIllegalKeys+": \"description.\", \"name]\"" {
t.Errorf("Expected error %q, got %q", ErrIllegalKeys+": \"description.\", \"name]\"", err.Error())
} else if !strings.Contains(err.Error(), ErrIllegalKeys) {
t.Errorf("Expected error to contain%q, got %q", ErrIllegalKeys, err.Error())
}
}

0 comments on commit 50463a4

Please sign in to comment.