1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: Apache-2.0
8 "github.com/ghodss/yaml"
9 check "gopkg.in/check.v1"
12 var _ = check.Suite(&ConfigSuite{})
14 type ConfigSuite struct{}
16 func (s *ConfigSuite) TestInstanceTypesAsArray(c *check.C) {
18 yaml.Unmarshal([]byte("InstanceTypes:\n- Name: foo\n"), &cluster)
19 c.Check(len(cluster.InstanceTypes), check.Equals, 1)
20 c.Check(cluster.InstanceTypes["foo"].Name, check.Equals, "foo")
23 func (s *ConfigSuite) TestInstanceTypesAsHash(c *check.C) {
25 yaml.Unmarshal([]byte("InstanceTypes:\n foo:\n ProviderType: bar\n"), &cluster)
26 c.Check(len(cluster.InstanceTypes), check.Equals, 1)
27 c.Check(cluster.InstanceTypes["foo"].Name, check.Equals, "foo")
28 c.Check(cluster.InstanceTypes["foo"].ProviderType, check.Equals, "bar")