From 68fc1b6e5e0cfdabf813ce4219c7c4124ce1870d Mon Sep 17 00:00:00 2001 From: WonChul Heo Date: Fri, 11 Oct 2019 21:25:31 +0700 Subject: [PATCH] Migrate `assert` (#12643) --- model/cluster_info_test.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/model/cluster_info_test.go b/model/cluster_info_test.go index ec6ba6c1fd..4f81d221cc 100644 --- a/model/cluster_info_test.go +++ b/model/cluster_info_test.go @@ -6,6 +6,8 @@ package model import ( "strings" "testing" + + "github.com/stretchr/testify/assert" ) func TestClusterInfoJson(t *testing.T) { @@ -13,9 +15,7 @@ func TestClusterInfoJson(t *testing.T) { json := cluster.ToJson() result := ClusterInfoFromJson(strings.NewReader(json)) - if cluster.IpAddress != result.IpAddress { - t.Fatal("Ids do not match") - } + assert.Equal(t, cluster.IpAddress, result.IpAddress, "Ids do not match") } func TestClusterInfosJson(t *testing.T) { @@ -25,7 +25,5 @@ func TestClusterInfosJson(t *testing.T) { json := ClusterInfosToJson(clusterInfos) result := ClusterInfosFromJson(strings.NewReader(json)) - if clusterInfos[0].IpAddress != result[0].IpAddress { - t.Fatal("Ids do not match") - } + assert.Equal(t, clusterInfos[0].IpAddress, result[0].IpAddress, "Ids do not match") }