示例#1
0
func TestRestAPIKeyModify(t *testing.T) {
	t.Parallel()
	var req http.Request
	k := parse.RestAPIKey{
		ApplicationID: defaultApplicationID,
		RestAPIKey:    "42",
	}
	ensure.Nil(t, k.Modify(&req))
	ensure.DeepEqual(t, req.Header.Get("X-Parse-Application-ID"), k.ApplicationID)
	ensure.DeepEqual(t, req.Header.Get("X-Parse-REST-API-Key"), k.RestAPIKey)
}
示例#2
0
func TestEmptyRestAPIKey(t *testing.T) {
	t.Parallel()
	mk := parse.RestAPIKey{ApplicationID: defaultApplicationID}
	ensure.Err(t, mk.Modify(nil), regexp.MustCompile("empty RestAPIKey"))
}
示例#3
0
func TestRestAPIKeyEmptyApplicationID(t *testing.T) {
	t.Parallel()
	var mk parse.RestAPIKey
	ensure.Err(t, mk.Modify(nil), regexp.MustCompile("empty ApplicationID"))
}