예제 #1
0
func TestEmptySessionTokenInSessionToken(t *testing.T) {
	t.Parallel()
	st := parse.SessionToken{
		ApplicationID: defaultApplicationID,
		RestAPIKey:    "rk",
	}
	ensure.Err(t, st.Modify(nil), regexp.MustCompile("empty SessionToken"))
}
예제 #2
0
func TestSessionTokenModify(t *testing.T) {
	t.Parallel()
	st := parse.SessionToken{
		ApplicationID: defaultApplicationID,
		RestAPIKey:    "42",
		SessionToken:  "43",
	}
	var req http.Request
	ensure.Nil(t, st.Modify(&req))
	ensure.DeepEqual(t, req.Header.Get("X-Parse-Application-ID"), st.ApplicationID)
	ensure.DeepEqual(t, req.Header.Get("X-Parse-REST-API-Key"), st.RestAPIKey)
	ensure.DeepEqual(t, req.Header.Get("X-Parse-Session-Token"), st.SessionToken)
}
예제 #3
0
func TestEmptySessionToken(t *testing.T) {
	t.Parallel()
	var st parse.SessionToken
	ensure.Err(t, st.Modify(nil), regexp.MustCompile("empty ApplicationID"))
}