update testing.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2016-04-08 19:31:47 +08:00
parent 1fd41ca503
commit b71b427786
2 changed files with 14 additions and 0 deletions

View File

@ -75,3 +75,15 @@ func TestErrorLogPath(t *testing.T) {
assert.NotNil(t, InitLog()) 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))
}

View File

@ -205,6 +205,8 @@ func TestAndroidPushHandler(t *testing.T) {
PushConf.Android.Enabled = true PushConf.Android.Enabled = true
PushConf.Android.ApiKey = os.Getenv("ANDROID_API_KEY") PushConf.Android.ApiKey = os.Getenv("ANDROID_API_KEY")
// log for json
PushConf.Log.Format = "json"
android_token := os.Getenv("ANDROID_TEST_TOKEN") android_token := os.Getenv("ANDROID_TEST_TOKEN")