SimpleCloudNotifier/scnserver/test/compat_test.go

29 lines
723 B
Go
Raw Normal View History

2022-12-09 00:13:10 +01:00
package test
import (
tt "blackforestbytes.com/simplecloudnotifier/test/util"
"fmt"
"github.com/gin-gonic/gin"
"testing"
)
func TestCreateCompatUser(t *testing.T) {
_, baseUrl, stop := tt.StartSimpleWebserver(t)
defer stop()
r0 := tt.RequestGet[gin.H](t, baseUrl, fmt.Sprintf("/api/register.php?fcm_token=%s&pro=%s&pro_token=%s", "DUMMY_FCM", "0", ""))
tt.AssertEqual(t, "success", true, r0["success"])
userid := int64(r0["user_id"].(float64))
userkey := r0["user_key"].(string)
r1 := tt.RequestGet[gin.H](t, baseUrl, fmt.Sprintf("/api/info.php?user_id=%d&user_key=%s", userid, userkey))
tt.AssertEqual(t, "success", true, r1["success"])
}
2022-12-09 00:13:10 +01:00
//TODO test compat methods
//TODO also test compat_id mapping