forked from livecode/livecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforms.livecodescript
More file actions
32 lines (25 loc) · 980 Bytes
/
Copy pathforms.livecodescript
File metadata and controls
32 lines (25 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
script "TestlibUrlForms"
on TestSetup
TestSkipIfNot "platform", "MacOS,Windows,Linux"
TestSkipIf "environment", "server"
if not TestIsInStandalone() then
local tLibURl
put TestGetEngineRepositoryPath() & "/ide-support/revliburl.livecodescript" into tLibUrl
send "extensionInitialize" to stack tLibUrl
end if
end TestSetup
on TestForm
put empty into tForm
put "name" into tName
put "message" into tMessage
put libURLMultipartFormData (tForm, "name", tName, "message", tMessage) into tError
TestAssert "form created", tError is empty
set the httpHeaders to line 1 of tForm
delete line 1 of tForm
put "<file>" & TestGetInputFile("last, first.txt") into tFile
put "text/plain" into tType
put "binary" into tEnc
put libURLMultipartFormAddPart(tForm,"file", tFile, tType, tEnc) into tError
TestAssert "file successfully added to form", tError is empty
set the httpHeaders to empty
end TestForm