Beispiel #1
0
func TestMasterKeyModify(t *testing.T) {
	t.Parallel()
	var req http.Request
	k := parse.MasterKey{
		ApplicationID: defaultApplicationID,
		MasterKey:     "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-Master-Key"), k.MasterKey)
}
Beispiel #2
0
func TestEmptyMasterKey(t *testing.T) {
	t.Parallel()
	mk := parse.MasterKey{ApplicationID: defaultApplicationID}
	ensure.Err(t, mk.Modify(nil), regexp.MustCompile("empty MasterKey"))
}
Beispiel #3
0
func TestMasterKeyEmptyApplicationID(t *testing.T) {
	t.Parallel()
	var mk parse.MasterKey
	ensure.Err(t, mk.Modify(nil), regexp.MustCompile("empty ApplicationID"))
}