testing string format of log.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
09a90e28fa
commit
86002dd4be
|
@ -261,7 +261,7 @@ func TestPushToAndroidWrongToken(t *testing.T) {
|
||||||
assert.True(t, success)
|
assert.True(t, success)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPushToAndroidRightToken(t *testing.T) {
|
func TestPushToAndroidRightTokenForJSONLog(t *testing.T) {
|
||||||
PushConf = BuildDefaultPushConf()
|
PushConf = BuildDefaultPushConf()
|
||||||
|
|
||||||
PushConf.Android.Enabled = true
|
PushConf.Android.Enabled = true
|
||||||
|
@ -281,6 +281,24 @@ func TestPushToAndroidRightToken(t *testing.T) {
|
||||||
assert.True(t, success)
|
assert.True(t, success)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestPushToAndroidRightTokenForStringLog(t *testing.T) {
|
||||||
|
PushConf = BuildDefaultPushConf()
|
||||||
|
|
||||||
|
PushConf.Android.Enabled = true
|
||||||
|
PushConf.Android.ApiKey = os.Getenv("ANDROID_API_KEY")
|
||||||
|
|
||||||
|
android_token := os.Getenv("ANDROID_TEST_TOKEN")
|
||||||
|
|
||||||
|
req := RequestPushNotification{
|
||||||
|
Tokens: []string{android_token, "bbbbb"},
|
||||||
|
Platform: 2,
|
||||||
|
Message: "Welcome",
|
||||||
|
}
|
||||||
|
|
||||||
|
success := PushToAndroid(req)
|
||||||
|
assert.True(t, success)
|
||||||
|
}
|
||||||
|
|
||||||
func TestOverwriteAndroidApiKey(t *testing.T) {
|
func TestOverwriteAndroidApiKey(t *testing.T) {
|
||||||
PushConf = BuildDefaultPushConf()
|
PushConf = BuildDefaultPushConf()
|
||||||
|
|
||||||
|
|
|
@ -205,8 +205,6 @@ func TestHalfSuccessAndroidPushHandler(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")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue