本文整理汇总了Golang中github.com/juju/juju/state/cloudimagemetadata.MetadataAttributes.Arch方法的典型用法代码示例。如果您正苦于以下问题:Golang MetadataAttributes.Arch方法的具体用法?Golang MetadataAttributes.Arch怎么用?Golang MetadataAttributes.Arch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/juju/juju/state/cloudimagemetadata.MetadataAttributes
的用法示例。
在下文中一共展示了MetadataAttributes.Arch方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: TestSupportedArchitectures
func (s *cloudImageMetadataSuite) TestSupportedArchitectures(c *gc.C) {
stream := "stream"
region := "region-test"
arch1 := "arch"
attrs := cloudimagemetadata.MetadataAttributes{
Stream: stream,
Region: region,
Version: "14.04",
Series: "trusty",
Arch: arch1,
VirtType: "virtType-test",
Source: "test",
RootStorageType: "rootStorageType-test"}
added := cloudimagemetadata.Metadata{attrs, 0, "1", 0}
s.assertRecordMetadata(c, added)
s.assertMetadataRecorded(c, attrs, added)
addedNonUnique := cloudimagemetadata.Metadata{attrs, 0, "21", 0}
s.assertRecordMetadata(c, addedNonUnique)
s.assertMetadataRecorded(c, attrs, addedNonUnique)
arch2 := "anotherArch"
attrs.Arch = arch2
added2 := cloudimagemetadata.Metadata{attrs, 0, "21", 0}
s.assertRecordMetadata(c, added2)
s.assertMetadataRecorded(c, attrs, added2)
expected := []string{arch1, arch2}
uniqueArches, err := s.storage.SupportedArchitectures(
cloudimagemetadata.MetadataFilter{Stream: stream, Region: region})
c.Assert(err, jc.ErrorIsNil)
c.Assert(uniqueArches, gc.DeepEquals, expected)
}