Skip to content

Commit

Permalink
checkMetadata_test: add extra check for invalid keys
Browse files Browse the repository at this point in the history
  • Loading branch information
consolethinks committed Aug 23, 2024
1 parent 640dfd6 commit ea9af2e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion datasetIngestor/checkMetadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,11 @@ 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 !strings.Contains(err.Error(), ErrIllegalKeys) {
t.Errorf("Expected error to contain%q, got %q", ErrIllegalKeys, err.Error())
} else if !strings.Contains(err.Error(), "description.") || !strings.Contains(err.Error(), "name]") {
t.Errorf("Expected error to list the following illegal keys: \"description.\", \"name]\"")
}
}

0 comments on commit ea9af2e

Please sign in to comment.