summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarshit Shah <darnir@gnu.org>2020-12-28 01:54:16 +0100
committerDarshit Shah <darnir@gnu.org>2020-12-28 01:54:16 +0100
commit010cb79b4314f501ef3968d7e1fee6bd9c13dc17 (patch)
tree36b848f1f4f875bdb86b4d3f6afd788563be417f
parent7c4d053902ee864ed536e3036e48bac92dd68ceb (diff)
downloadwget-010cb79b4314f501ef3968d7e1fee6bd9c13dc17.tar.gz
Fix usage of Magic number of tests
testenv/test/base_test.py: Add new variable SKIP_TEST testenv/Test--https-crl.py: Use SKIP_TEST instead of magic number testenv/Test--https.py: Same testenv/Test-hsts.py: Same testenv/Test-no_proxy-env.py: Same testenv/Test-pinnedpubkey-der-https.py: Same testenv/Test-pinnedpubkey-der-no-check-https.py: Same testenv/Test-pinnedpubkey-hash-https.py: Same testenv/Test-pinnedpubkey-hash-no-check-fail-https.py: Same testenv/Test-pinnedpubkey-pem-fail-https.py: Same testenv/Test-pinnedpubkey-pem-https.py: Same
-rwxr-xr-xtestenv/Test--https-crl.py4
-rwxr-xr-xtestenv/Test--https.py4
-rwxr-xr-xtestenv/Test-hsts.py4
-rwxr-xr-xtestenv/Test-no_proxy-env.py3
-rwxr-xr-xtestenv/Test-pinnedpubkey-der-https.py4
-rwxr-xr-xtestenv/Test-pinnedpubkey-der-no-check-https.py4
-rwxr-xr-xtestenv/Test-pinnedpubkey-hash-https.py4
-rwxr-xr-xtestenv/Test-pinnedpubkey-hash-no-check-fail-https.py4
-rwxr-xr-xtestenv/Test-pinnedpubkey-pem-fail-https.py4
-rwxr-xr-xtestenv/Test-pinnedpubkey-pem-https.py4
-rw-r--r--testenv/test/base_test.py1
11 files changed, 21 insertions, 19 deletions
diff --git a/testenv/Test--https-crl.py b/testenv/Test--https-crl.py
index 7f957f9a..6c7002e5 100755
--- a/testenv/Test--https-crl.py
+++ b/testenv/Test--https-crl.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
from sys import exit
from test.http_test import HTTPTest
-from test.base_test import HTTP, HTTPS
+from test.base_test import HTTPS, SKIP_TEST
from misc.wget_file import WgetFile
import os
@@ -9,7 +9,7 @@ import os
This test ensures that Wget can download files from HTTPS Servers
"""
if os.getenv('SSL_TESTS') is None:
- exit (77)
+ exit (SKIP_TEST)
############# File Definitions ###############################################
File1 = "Would you like some Tea?"
diff --git a/testenv/Test--https.py b/testenv/Test--https.py
index 426c3683..f3e14151 100755
--- a/testenv/Test--https.py
+++ b/testenv/Test--https.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
from sys import exit
from test.http_test import HTTPTest
-from test.base_test import HTTP, HTTPS
+from test.base_test import HTTPS
from misc.wget_file import WgetFile
import os
@@ -9,7 +9,7 @@ import os
This test ensures that Wget can download files from HTTPS Servers
"""
if os.getenv('SSL_TESTS') is None:
- exit (77)
+ exit (SKIP_TEST)
############# File Definitions ###############################################
File1 = "Would you like some Tea?"
diff --git a/testenv/Test-hsts.py b/testenv/Test-hsts.py
index f601ba6a..19bd4c41 100755
--- a/testenv/Test-hsts.py
+++ b/testenv/Test-hsts.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
from sys import exit
from test.http_test import HTTPTest
-from test.base_test import HTTP, HTTPS
+from test.base_test import HTTPS, SKIP_TEST
from misc.wget_file import WgetFile
import time
import os
@@ -12,7 +12,7 @@ This test makes sure Wget can parse a given HSTS database and apply the indicate
print (os.getenv('SSL_TESTS'))
if os.getenv('SSL_TESTS') is None:
- exit (77)
+ exit (SKIP_TEST)
def hsts_database_path():
hsts_file = ".wget-hsts-testenv"
diff --git a/testenv/Test-no_proxy-env.py b/testenv/Test-no_proxy-env.py
index 7d15ffdc..beec72eb 100755
--- a/testenv/Test-no_proxy-env.py
+++ b/testenv/Test-no_proxy-env.py
@@ -2,6 +2,7 @@
import socket
from sys import exit
from test.http_test import HTTPTest
+from test.base_test import SKIP_TEST
from test.base_test import HTTP
from misc.wget_file import WgetFile
@@ -36,7 +37,7 @@ for hostname in hostnames_to_check:
except socket.gaierror as _:
# resolution of the name fails
# return value 77 -> SKIP
- exit(77)
+ exit(SKIP_TEST)
# File Definitions
File1 = "Would you like some Tea?"
diff --git a/testenv/Test-pinnedpubkey-der-https.py b/testenv/Test-pinnedpubkey-der-https.py
index 784eac46..1e55d688 100755
--- a/testenv/Test-pinnedpubkey-der-https.py
+++ b/testenv/Test-pinnedpubkey-der-https.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
from sys import exit
from test.http_test import HTTPTest
-from test.base_test import HTTP, HTTPS
+from test.base_test import HTTPS, SKIP_TEST
from misc.wget_file import WgetFile
import os
@@ -9,7 +9,7 @@ import os
This test ensures that Wget can download files from HTTPS Servers
"""
if os.getenv('SSL_TESTS') is None:
- exit (77)
+ exit (SKIP_TEST)
############# File Definitions ###############################################
File1 = "Would you like some Tea?"
diff --git a/testenv/Test-pinnedpubkey-der-no-check-https.py b/testenv/Test-pinnedpubkey-der-no-check-https.py
index 5979d364..44a70980 100755
--- a/testenv/Test-pinnedpubkey-der-no-check-https.py
+++ b/testenv/Test-pinnedpubkey-der-no-check-https.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
from sys import exit
from test.http_test import HTTPTest
-from test.base_test import HTTP, HTTPS
+from test.base_test import HTTPS, SKIP_TEST
from misc.wget_file import WgetFile
import os
@@ -9,7 +9,7 @@ import os
This test ensures that Wget can download files from HTTPS Servers
"""
if os.getenv('SSL_TESTS') is None:
- exit (77)
+ exit (SKIP_TEST)
############# File Definitions ###############################################
File1 = "Would you like some Tea?"
diff --git a/testenv/Test-pinnedpubkey-hash-https.py b/testenv/Test-pinnedpubkey-hash-https.py
index d588d416..5cdc9877 100755
--- a/testenv/Test-pinnedpubkey-hash-https.py
+++ b/testenv/Test-pinnedpubkey-hash-https.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
from sys import exit
from test.http_test import HTTPTest
-from test.base_test import HTTP, HTTPS
+from test.base_test import HTTPS, SKIP_TEST
from misc.wget_file import WgetFile
import os
@@ -9,7 +9,7 @@ import os
This test ensures that Wget can download files from HTTPS Servers
"""
if os.getenv('SSL_TESTS') is None:
- exit (77)
+ exit (SKIP_TEST)
############# File Definitions ###############################################
File1 = "Would you like some Tea?"
diff --git a/testenv/Test-pinnedpubkey-hash-no-check-fail-https.py b/testenv/Test-pinnedpubkey-hash-no-check-fail-https.py
index 340169c7..52030395 100755
--- a/testenv/Test-pinnedpubkey-hash-no-check-fail-https.py
+++ b/testenv/Test-pinnedpubkey-hash-no-check-fail-https.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
from sys import exit
from test.http_test import HTTPTest
-from test.base_test import HTTP, HTTPS
+from test.base_test import HTTPS, SKIP_TEST
from misc.wget_file import WgetFile
import os
@@ -9,7 +9,7 @@ import os
This test ensures that Wget can download files from HTTPS Servers
"""
if os.getenv('SSL_TESTS') is None:
- exit (77)
+ exit (SKIP_TEST)
############# File Definitions ###############################################
File1 = "Would you like some Tea?"
diff --git a/testenv/Test-pinnedpubkey-pem-fail-https.py b/testenv/Test-pinnedpubkey-pem-fail-https.py
index 130fca7e..c6f7f1e0 100755
--- a/testenv/Test-pinnedpubkey-pem-fail-https.py
+++ b/testenv/Test-pinnedpubkey-pem-fail-https.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
from sys import exit
from test.http_test import HTTPTest
-from test.base_test import HTTP, HTTPS
+from test.base_test import HTTPS, SKIP_TEST
from misc.wget_file import WgetFile
import os
@@ -9,7 +9,7 @@ import os
This test ensures that Wget can download files from HTTPS Servers
"""
if os.getenv('SSL_TESTS') is None:
- exit (77)
+ exit (SKIP_TEST)
############# File Definitions ###############################################
File1 = "Would you like some Tea?"
diff --git a/testenv/Test-pinnedpubkey-pem-https.py b/testenv/Test-pinnedpubkey-pem-https.py
index 7ed94191..dcc0c554 100755
--- a/testenv/Test-pinnedpubkey-pem-https.py
+++ b/testenv/Test-pinnedpubkey-pem-https.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
from sys import exit
from test.http_test import HTTPTest
-from test.base_test import HTTP, HTTPS
+from test.base_test import HTTPS, SKIP_TEST
from misc.wget_file import WgetFile
import os
@@ -9,7 +9,7 @@ import os
This test ensures that Wget can download files from HTTPS Servers
"""
if os.getenv('SSL_TESTS') is None:
- exit (77)
+ exit (SKIP_TEST)
############# File Definitions ###############################################
File1 = "Would you like some Tea?"
diff --git a/testenv/test/base_test.py b/testenv/test/base_test.py
index 228f728b..1cdfba15 100644
--- a/testenv/test/base_test.py
+++ b/testenv/test/base_test.py
@@ -13,6 +13,7 @@ import conf
HTTP = "HTTP"
HTTPS = "HTTPS"
+SKIP_TEST = 77
class BaseTest: