Files
EWF/library/client/http_client/tests/test.e
unknown 497fe03d38 libcurl: Applied a workaround to avoid issue on Win32 (see LIBCURL_HTTP_CLIENT_REQUEST.apply_workaround)
Separated the http_client-safe.ecf and test-safe.ecf
Added HTTP_CLIENT_SESSION.set_max_redirects
Fixed broken test due to formatting trouble.
2012-02-08 21:32:25 +01:00

51 lines
918 B
Plaintext

class TEST
create
make
feature -- Init
make
do
test_http_client
end
test_http_client
-- New test routine
local
sess: LIBCURL_HTTP_CLIENT_SESSION
h: STRING_8
do
create sess.make ("http://www.google.com")
if attached sess.get ("/search?q=eiffel", Void) as res then
assert ("Get returned without error", not res.error_occurred)
create h.make_empty
if attached res.headers as hds then
across
hds as c
loop
h.append (c.item.name + ": " + c.item.value + "%R%N")
end
end
if attached res.body as l_body then
assert ("body not empty", not l_body.is_empty)
end
assert ("same headers", h.same_string (res.raw_header))
else
assert ("Not found", False)
end
end
assert (m: READABLE_STRING_8; b: BOOLEAN)
local
e: DEVELOPER_EXCEPTION
do
if not b then
create e
e.set_message (m)
e.raise
end
end
end