X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/06c2c19bfe18a52348b72d93db59df4b03a4fcaa..1a61611cbb8ed4471eb2e04e60bad548bff94678:/sdk/go/arvados/vocabulary_test.go diff --git a/sdk/go/arvados/vocabulary_test.go b/sdk/go/arvados/vocabulary_test.go index 84b9bf2295..af62833a31 100644 --- a/sdk/go/arvados/vocabulary_test.go +++ b/sdk/go/arvados/vocabulary_test.go @@ -230,14 +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, + "container_request": true, + "container_uuid": true, + "cwl_input": true, + "cwl_output": true, "docker-image-repo-tag": true, "filters": true, - "container_request": true, + "groups": true, + "image_timestamp": true, + "template_uuid": true, + "type": true, + "username": true, }, StrictTags: false, Tags: map[string]VocabularyTag{ @@ -298,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