diff --git a/gorush/log_test.go b/gorush/log_test.go index dd08f3d..1229a26 100644 --- a/gorush/log_test.go +++ b/gorush/log_test.go @@ -75,3 +75,15 @@ func TestErrorLogPath(t *testing.T) { assert.NotNil(t, InitLog()) } + +func TestPlatFormType(t *testing.T) { + assert.Equal(t, "ios", typeForPlatForm(PlatFormIos)) + assert.Equal(t, "android", typeForPlatForm(PlatFormAndroid)) + assert.Equal(t, "", typeForPlatForm(10000)) +} + +func TestPlatFormColor(t *testing.T) { + assert.Equal(t, blue, colorForPlatForm(PlatFormIos)) + assert.Equal(t, yellow, colorForPlatForm(PlatFormAndroid)) + assert.Equal(t, reset, colorForPlatForm(1000000)) +} diff --git a/gorush/server_test.go b/gorush/server_test.go index fb8af9f..1f69eab 100644 --- a/gorush/server_test.go +++ b/gorush/server_test.go @@ -205,6 +205,8 @@ func TestAndroidPushHandler(t *testing.T) { PushConf.Android.Enabled = true PushConf.Android.ApiKey = os.Getenv("ANDROID_API_KEY") + // log for json + PushConf.Log.Format = "json" android_token := os.Getenv("ANDROID_TEST_TOKEN")