mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
ci: fix failing vweb_test.v
This commit is contained in:
parent
e1c762a616
commit
f96b81b53a
@ -41,7 +41,7 @@ fn main() {
|
||||
url := 'https://api.caiyunapp.com/v2.5/96Ly7wgKGq6FhllM/116.391912,40.010711/weather.jsonp?hourlysteps=120&random=$rnd'
|
||||
// println(url)
|
||||
|
||||
resp := http.fetch(url, config) or {
|
||||
resp := http.fetch(http.FetchConfig{ ...config, url: url }) or {
|
||||
println('failed to fetch data from the server')
|
||||
return
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ fn main() {
|
||||
config := http.FetchConfig{
|
||||
user_agent: 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0'
|
||||
}
|
||||
resp := http.fetch('https://tuicool.com', config) or {
|
||||
resp := http.fetch(http.FetchConfig{ ...config, url: 'https://tuicool.com' }) or {
|
||||
println('failed to fetch data from the server')
|
||||
return
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ fn http_fetch_mock(_methods []string, _config FetchConfig) ?[]Response {
|
||||
for method in methods {
|
||||
lmethod := method.to_lower()
|
||||
config.method = method_from_str(method)
|
||||
res := fetch(url + lmethod, config) ?
|
||||
res := fetch(FetchConfig{ ...config, url: url + lmethod }) ?
|
||||
// TODO
|
||||
// body := json.decode(HttpbinResponseBody,res.text)?
|
||||
result << res
|
||||
|
@ -212,7 +212,8 @@ Content-Disposition: form-data; name=\"$name\"
|
||||
$contents
|
||||
--------------------------$boundary--
|
||||
"
|
||||
mut x := http.fetch('http://127.0.0.1:$sport/form_echo',
|
||||
mut x := http.fetch(
|
||||
url: 'http://127.0.0.1:$sport/form_echo'
|
||||
method: .post
|
||||
header: http.new_header(
|
||||
key: .content_type
|
||||
@ -238,7 +239,8 @@ fn test_http_client_shutdown_does_not_work_without_a_cookie() {
|
||||
fn testsuite_end() {
|
||||
// This test is guaranteed to be called last.
|
||||
// It sends a request to the server to shutdown.
|
||||
x := http.fetch('http://127.0.0.1:$sport/shutdown',
|
||||
x := http.fetch(
|
||||
url: 'http://127.0.0.1:$sport/shutdown'
|
||||
method: .get
|
||||
cookies: {
|
||||
'skey': 'superman'
|
||||
|
Loading…
Reference in New Issue
Block a user