mirror of
https://github.com/mirror/wget.git
synced 2025-02-05 01:01:00 +08:00
Add new Test for Continue command
This commit is contained in:
parent
738b299419
commit
60d1f4d1ad
@ -1,3 +1,8 @@
|
||||
2013-09-04 Darshit Shah <darnir@gmail.com>
|
||||
|
||||
* Test-c-full.py: Test Continue options
|
||||
* Makefile.am: Add Test-c-full.py and Test-O
|
||||
|
||||
2013-09-02 Darshit Shah <darnir@gmail.com>
|
||||
|
||||
* Makefile.am: Add new Test
|
||||
|
@ -35,9 +35,11 @@ TESTS = Test-auth-basic-fail.py \
|
||||
Test-auth-no-challenge.py \
|
||||
Test-auth-no-challenge-url.py \
|
||||
Test-auth-retcode.py \
|
||||
Test-c-full.py \
|
||||
Test-Content-disposition-2.py \
|
||||
Test-Content-disposition.py \
|
||||
Test-Head.py
|
||||
Test-Head.py \
|
||||
Test-O.py
|
||||
|
||||
XFAIL_TESTS = Test-auth-both.py
|
||||
LOG_COMPILER = python3
|
||||
|
52
testenv/Test-c-full.py
Executable file
52
testenv/Test-c-full.py
Executable file
@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env python3
|
||||
from sys import exit
|
||||
from WgetTest import HTTPTest, WgetFile
|
||||
|
||||
"""
|
||||
Test Wget's response when the file requested already exists on disk with
|
||||
a filesize greater than or equal to the requested file.
|
||||
"""
|
||||
TEST_NAME = "Test continue option"
|
||||
############# File Definitions ###############################################
|
||||
File1 = "abababababababababababababababababababababababababababababababababab"
|
||||
File2 = "ababababababababababababababababababab"
|
||||
|
||||
A_File = WgetFile ("File1", File1)
|
||||
B_File = WgetFile ("File1", File1)
|
||||
|
||||
C_File = WgetFile ("File2", File1)
|
||||
D_File = WgetFile ("File2", File2)
|
||||
|
||||
E_File = WgetFile ("File3", File1)
|
||||
|
||||
WGET_OPTIONS = "-d -c"
|
||||
WGET_URLS = ["File1", "File2", "File3"]
|
||||
|
||||
Files = [A_File, C_File, E_File]
|
||||
Existing_Files = [B_File, D_File]
|
||||
|
||||
ExpectedReturnCode = 0
|
||||
ExpectedDownloadedFiles = [A_File, C_File, E_File]
|
||||
|
||||
################ Pre and Post Test Hooks #####################################
|
||||
pre_test = {
|
||||
"ServerFiles" : Files,
|
||||
"LocalFiles" : Existing_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)
|
Loading…
Reference in New Issue
Block a user