diff options
author | Clément Bénier <clement.benier@iot.bzh> | 2018-10-23 15:09:06 +0200 |
---|---|---|
committer | Jan-Simon Moeller <jsmoeller@linuxfoundation.org> | 2018-10-24 10:43:37 +0000 |
commit | a740425411f120ff7263f16f268e7efd7c19b311 (patch) | |
tree | 4ef142dfb4b5c57648e4e00243a234b2ad31f086 /test/config_test.go | |
parent | 3e3222406a6f015a9fee3720e8ba76ecf58b087f (diff) |
testify: assert replace by require
require handles tests to be aborted during an assertion
contrary to assert
Change-Id: I3062046515c74509ae7ea1b24b7242a42d0191c1
Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
Diffstat (limited to 'test/config_test.go')
-rw-r--r-- | test/config_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/config_test.go b/test/config_test.go index 2b95e85..1b3120f 100644 --- a/test/config_test.go +++ b/test/config_test.go @@ -23,7 +23,7 @@ import ( "testing" "gerrit.automotivelinux.org/gerrit/src/xds/xds-server/lib/xsapiv1" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func CheckIP(ipconfig string) bool { @@ -41,13 +41,13 @@ func CheckIP(ipconfig string) bool { func TestConfig(t *testing.T) { var cfg xsapiv1.APIConfig - assert.Nil(t, HTTPCli.Get("/config", &cfg)) + require.Nil(t, HTTPCli.Get("/config", &cfg)) Debugf(t, "Config is %v", cfg) re := regexp.MustCompile("^[0-9a-z]+-[0-9a-z]+-[0-9a-z]+-[0-9a-z]+-[0-9a-z]+$") - assert.True(t, re.MatchString(cfg.ServerUID)) //ID + require.True(t, re.MatchString(cfg.ServerUID)) //ID pathMap, present := cfg.SupportedSharing["PathMap"] - assert.True(t, present) - assert.True(t, pathMap) - assert.True(t, CheckIP(cfg.Builder.IP)) + require.True(t, present) + require.True(t, pathMap) + require.True(t, CheckIP(cfg.Builder.IP)) } |