diff --git a/builder/amazon/common/artifact_test.go b/builder/amazon/common/artifact_test.go index 28af553c7..ccca4fa0a 100644 --- a/builder/amazon/common/artifact_test.go +++ b/builder/amazon/common/artifact_test.go @@ -1,21 +1,15 @@ package common import ( - "cgl.tideland.biz/asserts" "github.com/mitchellh/packer/packer" "testing" ) func TestArtifact_Impl(t *testing.T) { - assert := asserts.NewTestingAsserts(t, true) - - var actual packer.Artifact - assert.Implementor(&Artifact{}, &actual, "should be an Artifact") + var _ packer.Artifact = new(Artifact) } func TestArtifactId(t *testing.T) { - assert := asserts.NewTestingAsserts(t, true) - expected := `east:foo,west:bar` amis := make(map[string]string) @@ -27,12 +21,12 @@ func TestArtifactId(t *testing.T) { } result := a.Id() - assert.Equal(result, expected, "should match output") + if result != expected { + t.Fatalf("bad: %s", result) + } } func TestArtifactString(t *testing.T) { - assert := asserts.NewTestingAsserts(t, true) - expected := `AMIs were created: east: foo @@ -44,5 +38,7 @@ west: bar` a := &Artifact{Amis: amis} result := a.String() - assert.Equal(result, expected, "should match output") + if result != expected { + t.Fatalf("bad: %s", result) + } } diff --git a/builder/amazon/common/block_device_test.go b/builder/amazon/common/block_device_test.go index 0981816cf..2e671e3d6 100644 --- a/builder/amazon/common/block_device_test.go +++ b/builder/amazon/common/block_device_test.go @@ -1,14 +1,12 @@ package common import ( - "cgl.tideland.biz/asserts" "github.com/mitchellh/goamz/ec2" + "reflect" "testing" ) func TestBlockDevice(t *testing.T) { - assert := asserts.NewTestingAsserts(t, true) - ec2Mapping := []ec2.BlockDeviceMapping{ ec2.BlockDeviceMapping{ DeviceName: "/dev/sdb", @@ -36,6 +34,11 @@ func TestBlockDevice(t *testing.T) { LaunchMappings: []BlockDevice{blockDevice}, } - assert.Equal(ec2Mapping, blockDevices.BuildAMIDevices(), "should match output") - assert.Equal(ec2Mapping, blockDevices.BuildLaunchDevices(), "should match output") + if !reflect.DeepEqual(ec2Mapping, blockDevices.BuildAMIDevices()) { + t.Fatalf("bad: %#v", ec2Mapping) + } + + if !reflect.DeepEqual(ec2Mapping, blockDevices.BuildLaunchDevices()) { + t.Fatalf("bad: %#v", ec2Mapping) + } } diff --git a/builder/openstack/artifact_test.go b/builder/openstack/artifact_test.go index 2fb4de928..313fea7cf 100644 --- a/builder/openstack/artifact_test.go +++ b/builder/openstack/artifact_test.go @@ -1,21 +1,15 @@ package openstack import ( - "cgl.tideland.biz/asserts" "github.com/mitchellh/packer/packer" "testing" ) func TestArtifact_Impl(t *testing.T) { - assert := asserts.NewTestingAsserts(t, true) - - var actual packer.Artifact - assert.Implementor(&Artifact{}, &actual, "should be an Artifact") + var _ packer.Artifact = new(Artifact) } func TestArtifactId(t *testing.T) { - assert := asserts.NewTestingAsserts(t, true) - expected := `b8cdf55b-c916-40bd-b190-389ec144c4ed` a := &Artifact{ @@ -23,17 +17,19 @@ func TestArtifactId(t *testing.T) { } result := a.Id() - assert.Equal(result, expected, "should match output") + if result != expected { + t.Fatalf("bad: %s", result) + } } func TestArtifactString(t *testing.T) { - assert := asserts.NewTestingAsserts(t, true) - expected := "An image was created: b8cdf55b-c916-40bd-b190-389ec144c4ed" a := &Artifact{ ImageId: "b8cdf55b-c916-40bd-b190-389ec144c4ed", } result := a.String() - assert.Equal(result, expected, "should match output") + if result != expected { + t.Fatalf("bad: %s", result) + } }