예제 #1
0
func TestAddPlurkNoContent(t *testing.T) {
	testPath := "test/plurk_add.json"
	server := buildPlurkAddServer(testPath)
	defer server.Close()

	client = &plurk.PlurkClient{ApiBase: server.URL}

	_, content, _ := otto.Run(`("")`)
	funcCall := otto.FunctionCall{}
	funcCall.ArgumentList = append(funcCall.ArgumentList, content)

	result := plurk_AddPlurk(funcCall)
	success, _ := result.ToBoolean()

	assert.False(t, success)
}
예제 #2
0
func TestAddResponseNoContent(t *testing.T) {
	testPath := "test/response_add.json"
	server := buildResponseAddServer(testPath)
	defer server.Close()

	client = &plurk.PlurkClient{ApiBase: server.URL}

	_, plurkID, _ := otto.Run(`(123456)`)
	funcCall := otto.FunctionCall{}
	funcCall.ArgumentList = append(funcCall.ArgumentList, plurkID)

	result := plurk_AddResponse(funcCall)
	success, _ := result.ToBoolean()

	assert.False(t, success)
}