Add new Test for Continue command

This commit is contained in:
Darshit Shah 2013-09-04 23:46:34 +05:30
parent 738b299419
commit 60d1f4d1ad
3 changed files with 60 additions and 1 deletions

View File

@ -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

View File

@ -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
View 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)