packer-cn/builder/yandex/artifact_test.go
Gennady Lipenkov 8e4e314553 Bulk update 'yandex' builder
Squashed commit of the following:

commit ccc020231780179d241d46eef7c0ba103366aed0
Author: Yandex.Cloud Bot <ycloud-bot@yandex.ru>
Date:   Tue Apr 9 14:38:30 2019 +0000

    sync upstream
2019-04-12 01:00:54 +03:00

44 lines
885 B
Go

package yandex
import (
"testing"
"github.com/hashicorp/packer/packer"
"github.com/yandex-cloud/go-genproto/yandex/cloud/compute/v1"
)
func TestArtifact_impl(t *testing.T) {
var _ packer.Artifact = new(Artifact)
}
func TestArtifact_Id(t *testing.T) {
i := &compute.Image{
Id: "test-id-value",
FolderId: "test-folder-id",
}
a := &Artifact{
image: i}
expected := "test-id-value"
if a.Id() != expected {
t.Fatalf("artifact ID should match: %v", expected)
}
}
func TestArtifact_String(t *testing.T) {
i := &compute.Image{
Id: "test-id-value",
FolderId: "test-folder-id",
Name: "test-name",
Family: "test-family",
}
a := &Artifact{
image: i}
expected := "A disk image was created: test-name (id: test-id-value) with family name test-family"
if a.String() != expected {
t.Fatalf("artifact string should match: %v", expected)
}
}