Skip to content
This repository was archived by the owner on Feb 11, 2022. It is now read-only.

add tests#11

Open
ilmarkov wants to merge 15 commits into
tarantool:masterfrom
ilmarkov:master
Open

add tests#11
ilmarkov wants to merge 15 commits into
tarantool:masterfrom
ilmarkov:master

Conversation

@ilmarkov
Copy link
Copy Markdown

No description provided.

Comment thread tests/example.lua Outdated
-- So you have to ignore them
-- {{
package.preload['curl.driver'] = '../curl/driver.so'
-- package.preload['curl.driver'] = '../curl/driver.so'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will not work on local environment. For instance, If user has builded curl.driver locally and he has not installed curl.driver into OS.

Comment thread tests/example.lua Outdated
@@ -13,33 +13,39 @@ http = curl.http()
local headers = { my_header = "1", my_header2 = "2" }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you did these changes?

Comment thread tests/post.lua Outdated
-- So you have to ignore them
-- {{
package.preload['curl.driver'] = 'curl/driver.so'
-- package.preload['curl.driver'] = 'curl/driver.so'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment above

Comment thread tests/func_tests.lua Outdated
host_good = 'https://httpbin.org/get'
host_bad = 'https://httpbin.org/not_get'

--function valid_response_get(value)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these comments needed?

Comment thread tests/func_tests.lua Outdated


post_requests = {}
post_requests["sync_post_request"] = {f = http.sync_post_request, param = nil, host = "https://httpbin.org/post"}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A line length shouldn't be more than 80 symbols

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment above is a coding standard

Comment thread tests/func_tests.lua
http = curl.http()

--{{
-- Testing sync get calls
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sync_funcs does not called by this program

Comment thread tests/func_tests.lua
end
end

async_funcs = {}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

async_get does not called

Comment thread tests/func_tests.lua

function run(desc, func, param)
print('Running', desc)
ok, err = func(param)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run does not validate result. For instance, user did POST a data and that data has been corrupted by curl.driver (bug and so on).
Well, a good solution is validate a server's output body (echo server) and a client's input only if user's request has a body.

Comment thread curl/driver.c Outdated
}
}
else if (strcmp(method, "PUT") == 0) {
else if (strcmp(method, "PUT") == 0) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/t, or?

Comment thread curl/driver.c Outdated
lua_pop(L, 1);

/* Write callback */
/* Write callback */
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/t, or?

Comment thread tests/func_tests.lua Outdated
return true, _
end

--for key, value in pairs(sync_funcs)
Copy link
Copy Markdown

@dedok dedok Feb 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are those lines under comments?

Comment thread tests/func_tests.lua Outdated
return ctx.ok, ctx.msg
end

--for key, value in pairs(async_funcs)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why those lines are off?

Comment thread tests/func_tests.lua Outdated
return true
end

--for key, value in pairs(post_requests)
Copy link
Copy Markdown

@dedok dedok Feb 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are those lines under comments?

Comment thread README.md
-- failed (included systeme erros, curl errors, HTTP
-- erros and so on)
-- failed (included system erros, curl errors, and so on
-- but not HTTP errors)
Copy link
Copy Markdown

@dedok dedok Feb 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected version is - ... and so on. But the counter does not include HTTP errors.

Comment thread tests/func_tests.lua Outdated
}


value_header = "json/application"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

json/application -> application/json

@dedok
Copy link
Copy Markdown

dedok commented Feb 7, 2017

Any progress?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants