Skip to content

Commit

Permalink
Fix new python tests for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
lifenjoiner committed Mar 16, 2024
1 parent f8de4c3 commit 83965e9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/github-CI-Windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ jobs:
python3 -c "import sys; print(sys.executable)"
rm /$mingw/bin/python* 2>/dev/null
#pacman -R -dd --noconfirm mingw-w64-${{env.arch}}-python 2>/dev/null
python.exe -V
python.exe -c "import sys; print(sys.executable)"
# MinGW-w64 pre-installed
- name: Show setup result
Expand Down
2 changes: 1 addition & 1 deletion testenv/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ DEFAULT_TESTS = \
Test-cookie-expires.py \
Test-cookie.py \
Test-Head.py \
Test-https-k.py \
Test-k.py \
Test-missing-scheme-retval.py \
Test-O.py \
Expand All @@ -68,6 +67,7 @@ DEFAULT_TESTS = \

HTTPS_TESTS = \
Test-hsts.py \
Test-https-k.py \
Test--https.py \
Test--https-crl.py \
Test-pinnedpubkey-der-https.py \
Expand Down
17 changes: 13 additions & 4 deletions testenv/Test-k.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
characterset based on the current OS
"""

# MINGW32_NT-10.0-20348/MINGW64_NT-10.0-20348: requires Linux flavor
if platform.system()[0:10] in ["MINGW32_NT", "MINGW64_NT", "Windows"]:
converted_filename = "site;sub%3A.html"
converted_linkpath = "site%3Bsub%253A.html"
else:
converted_filename = "site;sub:.html"
converted_linkpath = "./site%3Bsub:.html"

############################## File Definitions ##############################
index = """
<html>
Expand All @@ -26,16 +34,16 @@
</html>
"""

converted = """
converted = '''
<html>
<head>
<title>Index</title>
</head>
<body>
<a href="./site%3Bsub:.html">Site</a>
<a href="''' + converted_linkpath + '''">Site</a>
</body>
</html>
"""
'''

site = """
<html>
Expand All @@ -50,6 +58,7 @@

IndexPage = WgetFile("index.html", index)
SubSite = WgetFile("site;sub:.html", site)
LocalSubSite = WgetFile(converted_filename, site)
LocalIndexPage = WgetFile("index.html", converted)

print(platform.system())
Expand All @@ -61,7 +70,7 @@
Files = [[IndexPage, SubSite]]

ExpectedReturnCode = 0
ExpectedDownloadedFiles = [LocalIndexPage, SubSite]
ExpectedDownloadedFiles = [LocalIndexPage, LocalSubSite]

########################### Pre and Post Test Hooks ##########################
pre_test = {
Expand Down

0 comments on commit 83965e9

Please sign in to comment.