mirror of
https://gitlab.com/gnuwget/wget.git
synced 2025-08-13 14:40:40 +00:00
Add test, Test-Head
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2013-09-02 Darshit Shah <darnir@gmail.com>
|
||||||
|
|
||||||
|
* Makefile.am: Add new Test
|
||||||
|
* Test-Head.py: New Test to ensure HEAD requests are handled correctly
|
||||||
|
|
||||||
2013-08-31 Darshit Shah <darnir@gmail.com>
|
2013-08-31 Darshit Shah <darnir@gmail.com>
|
||||||
|
|
||||||
* README: Explain that TEST_NAME needs to be unique
|
* README: Explain that TEST_NAME needs to be unique
|
||||||
|
@ -36,7 +36,8 @@ TESTS = Test-auth-basic-fail.py \
|
|||||||
Test-auth-no-challenge-url.py \
|
Test-auth-no-challenge-url.py \
|
||||||
Test-auth-retcode.py \
|
Test-auth-retcode.py \
|
||||||
Test-Content-disposition-2.py \
|
Test-Content-disposition-2.py \
|
||||||
Test-Content-disposition.py
|
Test-Content-disposition.py \
|
||||||
|
Test-Head.py
|
||||||
|
|
||||||
XFAIL_TESTS = Test-auth-both.py
|
XFAIL_TESTS = Test-auth-both.py
|
||||||
LOG_COMPILER = python3
|
LOG_COMPILER = python3
|
||||||
|
43
testenv/Test-Head.py
Executable file
43
testenv/Test-Head.py
Executable file
@ -0,0 +1,43 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
from sys import exit
|
||||||
|
from WgetTest import HTTPTest, WgetFile
|
||||||
|
|
||||||
|
"""
|
||||||
|
This test ensures that Wget correctly handles responses to HEAD requests
|
||||||
|
and does not actually download any data
|
||||||
|
"""
|
||||||
|
TEST_NAME = "HEAD Requests"
|
||||||
|
############# File Definitions ###############################################
|
||||||
|
File1 = "You shall not pass!"
|
||||||
|
|
||||||
|
A_File = WgetFile ("File1", File1)
|
||||||
|
|
||||||
|
WGET_OPTIONS = "-d --method=HEAD"
|
||||||
|
WGET_URLS = ["File1"]
|
||||||
|
|
||||||
|
Files = [A_File]
|
||||||
|
|
||||||
|
ExpectedReturnCode = 0
|
||||||
|
ExpectedDownloadedFiles = []
|
||||||
|
|
||||||
|
################ Pre and Post Test Hooks #####################################
|
||||||
|
pre_test = {
|
||||||
|
"ServerFiles" : Files,
|
||||||
|
}
|
||||||
|
test_options = {
|
||||||
|
"WgetCommands" : WGET_OPTIONS,
|
||||||
|
"Urls" : WGET_URLS
|
||||||
|
}
|
||||||
|
post_test = {
|
||||||
|
"ExpectedFiles" : ExpectedDownloadedFiles,
|
||||||
|
"ExpectedRetcode" : ExpectedReturnCode
|
||||||
|
}
|
||||||
|
|
||||||
|
err = HTTPTest (
|
||||||
|
name=TEST_NAME,
|
||||||
|
pre_hook=pre_test,
|
||||||
|
test_params=test_options,
|
||||||
|
post_hook=post_test
|
||||||
|
).begin ()
|
||||||
|
|
||||||
|
exit (err)
|
Reference in New Issue
Block a user