Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
andarut committed Dec 8, 2023
1 parent 3af1546 commit 1e4e66e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion tests/python/tests/curl/php/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,13 @@ function test_curl($curl_resumable = false) {

fwrite(STDERR, $output);

$resp = ["exec_result" => $output];

$resp = ["exec_result" => to_json_safe($output)];
if ($ob_json = ob_get_clean()) {
$resp["output_buffer"] = json_decode($ob_json);
}
echo json_encode($resp);
fwrite(STDERR, json_encode($resp));
}

function test_curl_reuse_handle($curl_resumable = false) {
Expand Down
10 changes: 8 additions & 2 deletions tests/python/tests/curl/test_curl_resumable.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ def test_curl_resumable_timeout(self):
})

def test_curl_resumable_nonexistent_url(self):
# self.assertEqual(self._curl_request("nonexistent_url"), {
# "exec_result": ''
# })
self.assertEqual(self._curl_request("nonexistent_url"), {
"exec_result": ''
"exec_result": False
})

def test_curl_resumable_connection_only_success(self):
Expand All @@ -62,6 +65,9 @@ def test_curl_resumable_connection_only_success(self):
})

def test_curl_resumable_connection_only_fail(self):
# self.assertEqual(self._curl_request("nonexistent_url", connect_only=True), {
# "exec_result": ''
# })
self.assertEqual(self._curl_request("nonexistent_url", connect_only=True), {
"exec_result": ''
"exec_result": False
})

0 comments on commit 1e4e66e

Please sign in to comment.