From 8267baa0b2d7ae54ac04cab60fb813a0d8f71999 Mon Sep 17 00:00:00 2001 From: Lvbo163 Date: Wed, 7 Mar 2018 11:23:26 +0800 Subject: add ut for getKubeMasterUrl add unit test for URL parser which can get k8s URL from start variable Issue-ID: MSB-169 Change-Id: Ifb9e43b5a3a1a16c24ce22b122d23223616e0e7a Signed-off-by: Lvbo163 --- src/kube2msb/kube2msb_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/kube2msb') diff --git a/src/kube2msb/kube2msb_test.go b/src/kube2msb/kube2msb_test.go index 3a4e3d9..435fb3f 100644 --- a/src/kube2msb/kube2msb_test.go +++ b/src/kube2msb/kube2msb_test.go @@ -48,7 +48,7 @@ func urlFormateValidate(t *testing.T, method string) { if method == "getMSBUrl" { argMSBUrl = &c.in got, _ = getMSBUrl() - } else { + } else if method == "getKubeMasterUrl" { argKubeMasterUrl = &c.in got, _ = getKubeMasterUrl() } @@ -58,6 +58,11 @@ func urlFormateValidate(t *testing.T, method string) { } } } + func TestGetMSBUrl(t *testing.T) { urlFormateValidate(t, "getMSBUrl") } + +func TestGetKubeMasterUrl(t *testing.T) { + urlFormateValidate(t, "getKubeMasterUrl") +} -- cgit 1.2.3-korg