X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/07baa0ed049746514495d1648c1aef0c40545141..e42bf8fbe66f822066e13c08b346005a52e1aa4a:/sdk/go/arvados/vocabulary_test.go diff --git a/sdk/go/arvados/vocabulary_test.go b/sdk/go/arvados/vocabulary_test.go index f31a4f984b..af62833a31 100644 --- a/sdk/go/arvados/vocabulary_test.go +++ b/sdk/go/arvados/vocabulary_test.go @@ -230,16 +230,17 @@ func (s *VocabularySuite) TestNewVocabulary(c *check.C) { true, "", &Vocabulary{ reservedTagKeys: map[string]bool{ - "type": true, - "template_uuid": true, - "groups": true, - "username": true, - "image_timestamp": true, - "docker-image-repo-tag": true, - "filters": true, "container_request": true, + "container_uuid": true, "cwl_input": true, "cwl_output": true, + "docker-image-repo-tag": true, + "filters": true, + "groups": true, + "image_timestamp": true, + "template_uuid": true, + "type": true, + "username": true, }, StrictTags: false, Tags: map[string]VocabularyTag{ @@ -300,6 +301,37 @@ func (s *VocabularySuite) TestNewVocabulary(c *check.C) { } } +func (s *VocabularySuite) TestValidSystemProperties(c *check.C) { + s.testVoc.StrictTags = true + properties := map[string]interface{}{ + "arv:gitBranch": "main", + "arv:OK": true, + "arv:cost": 123, + } + c.Check(s.testVoc.Check(properties), check.IsNil) +} + +func (s *VocabularySuite) TestSystemPropertiesPrefixTypo(c *check.C) { + s.testVoc.StrictTags = true + for _, key := range []string{ + // Extra characters in prefix + "arv :foo", + " arv:foo", + // Wrong punctuation + "arv.foo", + "arv-foo", + "arv_foo", + // Wrong case + "Arv:foo", + // Wrong word + "arvados", + "arvados:foo", + } { + properties := map[string]interface{}{key: "value"} + c.Check(s.testVoc.Check(properties), check.NotNil) + } +} + func (s *VocabularySuite) TestValidationErrors(c *check.C) { tests := []struct { name string