Debian Codegraph @

testenv/Test-missing-scheme-retval.py

raw
1 #!/usr/bin/env python3
2 from sys import exit
3 from test.http_test import HTTPTest
4 from test.base_test import HTTP
5 from misc.wget_file import WgetFile
6 import os
7
8 """
9 This test ensures that Wget complains about missing scheme
10 """
11 ############# File Definitions ###############################################
12 A_File = WgetFile ("bar", 'Content')
13
14 # put the URL into 'options' to avoid prepending scheme/localhost/port
15 WGET_OPTIONS = "/foo/bar"
16 WGET_URLS = [[]]
17
18 Files = [[A_File]]
19
20 ExpectedReturnCode = 1
21 ExpectedDownloadedFiles = []
22
23 ################ Pre and Post Test Hooks #####################################
24 pre_test = {
25 "ServerFiles" : Files,
26 }
27 test_options = {
28 "WgetCommands" : WGET_OPTIONS,
29 "Urls" : WGET_URLS
30 }
31 post_test = {
32 "ExpectedFiles" : ExpectedDownloadedFiles,
33 "ExpectedRetcode" : ExpectedReturnCode
34 }
35
36 err = HTTPTest (
37 pre_hook=pre_test,
38 test_params=test_options,
39 post_hook=post_test,
40 ).begin ()
41
42 exit (err)