From 3eb74f6a124cde0f9a4a6511b425d56d38420a4e Mon Sep 17 00:00:00 2001 From: Attila Martin Nacsa Date: Mon, 5 Aug 2024 17:23:21 +0200 Subject: [PATCH] checkMetadata_test: add extra check for invalid keys --- datasetIngestor/checkMetadata_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/datasetIngestor/checkMetadata_test.go b/datasetIngestor/checkMetadata_test.go index d8b16dc..2a9be98 100644 --- a/datasetIngestor/checkMetadata_test.go +++ b/datasetIngestor/checkMetadata_test.go @@ -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]\"") } }