mirror of
https://github.com/mirror/wget.git
synced 2026-09-05 22:24:56 +08:00
Improve error handling when wget executable isn't available
This commit is contained in:
committed by
Giuseppe Scrivano
parent
31868fed6c
commit
f616192dfd
@@ -1,3 +1,10 @@
|
|||||||
|
2013-12-25 Darshit Shah <darnir@gmail.com>
|
||||||
|
|
||||||
|
* WgetTest.py (CommonMehtods.exec_wget): Catch and handle exception if the
|
||||||
|
Wget executable is not found at src/wget
|
||||||
|
(HTTPTest.call_test): In case of error during execution, remove all existing
|
||||||
|
servers before quitting
|
||||||
|
|
||||||
2013-12-15 Darshit Shah <darnir@gmail.com>
|
2013-12-15 Darshit Shah <darnir@gmail.com>
|
||||||
|
|
||||||
* WgetTest.py (HTTPTest.HTTP_setup): Rename to Server_setup so it can be
|
* WgetTest.py (HTTPTest.HTTP_setup): Rename to Server_setup so it can be
|
||||||
|
|||||||
@@ -40,7 +40,11 @@ class CommonMethods:
|
|||||||
cmd_line = self.get_cmd_line (options, urls, domain_list)
|
cmd_line = self.get_cmd_line (options, urls, domain_list)
|
||||||
params = shlex.split (cmd_line)
|
params = shlex.split (cmd_line)
|
||||||
print (params)
|
print (params)
|
||||||
|
try:
|
||||||
retcode = call (params)
|
retcode = call (params)
|
||||||
|
except FileNotFoundError as filenotfound:
|
||||||
|
raise TestFailed (
|
||||||
|
"The Wget Executable does not exist at the expected path")
|
||||||
return retcode
|
return retcode
|
||||||
|
|
||||||
def get_cmd_line (self, options, urls, domain_list):
|
def get_cmd_line (self, options, urls, domain_list):
|
||||||
@@ -270,7 +274,11 @@ class HTTPTest (CommonMethods):
|
|||||||
raise TestFailed ("Test Option " + test_func + " unknown.")
|
raise TestFailed ("Test Option " + test_func + " unknown.")
|
||||||
getattr (self, test_func) (test_params[test_func])
|
getattr (self, test_func) (test_params[test_func])
|
||||||
|
|
||||||
|
try:
|
||||||
self.act_retcode = self.exec_wget (self.options, self.urls, self.domain_list)
|
self.act_retcode = self.exec_wget (self.options, self.urls, self.domain_list)
|
||||||
|
except TestFailed as tf:
|
||||||
|
self.stop_HTTP_Server ()
|
||||||
|
raise TestFailed (tf.__str__ ())
|
||||||
self.stop_HTTP_Server ()
|
self.stop_HTTP_Server ()
|
||||||
|
|
||||||
def post_hook_call (self, post_hook):
|
def post_hook_call (self, post_hook):
|
||||||
|
|||||||
Reference in New Issue
Block a user