本文整理汇总了Golang中github.com/juju/juju/apiserver/imagemetadata.ParseMetadataFromParams函数的典型用法代码示例。如果您正苦于以下问题:Golang ParseMetadataFromParams函数的具体用法?Golang ParseMetadataFromParams怎么用?Golang ParseMetadataFromParams使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ParseMetadataFromParams函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: TestParseMetadataCustom
func (s *funcSuite) TestParseMetadataCustom(c *gc.C) {
m := imagemetadata.ParseMetadataFromParams(params.CloudImageMetadata{Source: "custom"})
c.Assert(m, gc.DeepEquals, s.expected)
m = imagemetadata.ParseMetadataFromParams(params.CloudImageMetadata{Source: "CusTOM"})
c.Assert(m, gc.DeepEquals, s.expected)
}
开发者ID:mhilton,项目名称:juju,代码行数:7,代码来源:functions_test.go
示例2: TestParseMetadataPublic
func (s *funcSuite) TestParseMetadataPublic(c *gc.C) {
s.expected.Source = cloudimagemetadata.Public
m := imagemetadata.ParseMetadataFromParams(params.CloudImageMetadata{Source: "public"})
c.Assert(m, gc.DeepEquals, s.expected)
m = imagemetadata.ParseMetadataFromParams(params.CloudImageMetadata{Source: "PubLic"})
c.Assert(m, gc.DeepEquals, s.expected)
}
开发者ID:mhilton,项目名称:juju,代码行数:9,代码来源:functions_test.go
示例3: TestParseMetadataAnyRegion
func (s *funcSuite) TestParseMetadataAnyRegion(c *gc.C) {
region := "region"
s.expected.Region = region
m, err := imagemetadata.ParseMetadataFromParams(s.api, params.CloudImageMetadata{Region: region}, s.env)
c.Assert(err, jc.ErrorIsNil)
c.Assert(m, gc.DeepEquals, s.expected)
}
开发者ID:AlexisBruemmer,项目名称:juju,代码行数:8,代码来源:functions_test.go
示例4: TestParseMetadataAnyStream
func (s *funcSuite) TestParseMetadataAnyStream(c *gc.C) {
stream := "happy stream"
s.expected.Stream = stream
m, err := imagemetadata.ParseMetadataFromParams(s.api, params.CloudImageMetadata{Stream: stream}, s.env)
c.Assert(err, jc.ErrorIsNil)
c.Assert(m, gc.DeepEquals, s.expected)
}
开发者ID:AlexisBruemmer,项目名称:juju,代码行数:8,代码来源:functions_test.go
示例5: TestParseMetadataAnyStream
func (s *funcSuite) TestParseMetadataAnyStream(c *gc.C) {
stream := "happy stream"
s.expected.Stream = stream
m := imagemetadata.ParseMetadataFromParams(params.CloudImageMetadata{
Source: "custom",
Stream: stream,
})
c.Assert(m, gc.DeepEquals, s.expected)
}
开发者ID:mhilton,项目名称:juju,代码行数:10,代码来源:functions_test.go
示例6: TestParseMetadataDefaultStream
func (s *funcSuite) TestParseMetadataDefaultStream(c *gc.C) {
m, err := imagemetadata.ParseMetadataFromParams(s.api, params.CloudImageMetadata{}, s.env)
c.Assert(err, jc.ErrorIsNil)
c.Assert(m, gc.DeepEquals, s.expected)
}
开发者ID:AlexisBruemmer,项目名称:juju,代码行数:5,代码来源:functions_test.go
示例7: TestParseMetadataAnySource
func (s *funcSuite) TestParseMetadataAnySource(c *gc.C) {
s.expected.Source = "any"
m, err := imagemetadata.ParseMetadataFromParams(s.api, params.CloudImageMetadata{Source: "any"}, s.env)
c.Assert(err, jc.ErrorIsNil)
c.Assert(m, gc.DeepEquals, s.expected)
}
开发者ID:AlexisBruemmer,项目名称:juju,代码行数:6,代码来源:functions_test.go
示例8: TestParseMetadataDefaultStream
func (s *funcSuite) TestParseMetadataDefaultStream(c *gc.C) {
m := imagemetadata.ParseMetadataFromParams(params.CloudImageMetadata{
Source: "custom",
})
c.Assert(m, gc.DeepEquals, s.expected)
}
开发者ID:mhilton,项目名称:juju,代码行数:6,代码来源:functions_test.go
示例9: TestParseMetadataSourcePanic
func (s *funcSuite) TestParseMetadataSourcePanic(c *gc.C) {
m := func() { imagemetadata.ParseMetadataFromParams(params.CloudImageMetadata{}) }
c.Assert(m, gc.PanicMatches, `unknown cloud image metadata source ""`)
}
开发者ID:mhilton,项目名称:juju,代码行数:4,代码来源:functions_test.go
注:本文中的github.com/juju/juju/apiserver/imagemetadata.ParseMetadataFromParams函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论