Fix TestMisc.test_itms_services() on Python 3.12

E   -cache key itms-services:?action=download-manifest&url=http://www.example.com/
E   -real url itms-services:?action=download-manifest&url=http://www.example.com/
E   +cache key itms-services://?action=download-manifest&url=http://www.example.com/
E   +real url itms-services://?action=download-manifest&url=http://www.example.com/
E    valid

gh-104139: Teach urllib.parse.unsplit() to retain the "//" when assembling
itms-services://?action=generate-bugs style Apple Platform Deployment [2] URLs. [1]

[1]
https://docs.python.org/3.12/whatsnew/changelog.html

[2] "Distribute proprietary in-house apps to Apple devices":
https://support.apple.com/en-gb/guide/deployment/depce7cefc4d/web
This commit is contained in:
Chris Mayo 2023-09-06 19:22:04 +01:00
parent ce640dcc36
commit 40c39c27e6

View file

@ -16,6 +16,8 @@
"""
Test miscellaneous html tag parsing and URL types
"""
import sys
from tests import need_network
from . import LinkCheckTest
@ -41,7 +43,11 @@ class TestMisc(LinkCheckTest):
@need_network
def test_itms_services(self):
url = "itms-services:?action=download-manifest&url=http://www.example.com/"
if sys.version_info < (3, 12):
url = "itms-services:?action=download-manifest&url=http://www.example.com/"
else:
url = \
"itms-services://?action=download-manifest&url=http://www.example.com/"
resultlines = [
"url %s" % url,
"cache key %s" % url,