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