Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 44 additions & 2 deletions Tests/ScriptsTests/test_distribute_testflight_beta.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,52 @@ def test_parse_args_requires_platform(self):
"202606111944",
],
):
with mock.patch("sys.stderr", new_callable=io.StringIO):
with self.assertRaises(SystemExit):
with mock.patch("sys.stderr", new_callable=io.StringIO) as error_output:
with self.assertRaises(SystemExit) as context:
distribute_testflight_beta.parse_args()

self.assertEqual(context.exception.code, 2)
self.assertIn("the following arguments are required: --platform", error_output.getvalue())

def test_parse_args_accepts_each_supported_platform(self):
for platform in ("IOS", "MAC_OS", "TV_OS", "VISION_OS"):
with self.subTest(platform=platform):
with mock.patch(
"sys.argv",
[
"distribute-testflight-beta.py",
"--version",
"1.0.22",
"--build-number",
"202606111944",
"--platform",
platform,
],
):
arguments = distribute_testflight_beta.parse_args()

self.assertEqual(arguments.platform, platform)

def test_parse_args_rejects_unsupported_platform(self):
with mock.patch(
"sys.argv",
[
"distribute-testflight-beta.py",
"--version",
"1.0.22",
"--build-number",
"202606111944",
"--platform",
"ANDROID",
],
):
with mock.patch("sys.stderr", new_callable=io.StringIO) as error_output:
with self.assertRaises(SystemExit) as context:
distribute_testflight_beta.parse_args()

self.assertEqual(context.exception.code, 2)
self.assertIn("invalid choice: 'ANDROID'", error_output.getvalue())

def test_request_retries_transient_http_failures(self):
client = distribute_testflight_beta.ASCClient("token")

Expand Down
1 change: 0 additions & 1 deletion Tests/ScriptsTests/test_release_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,6 @@ def test_testflight_beta_distribution_workflow_uses_distribution_script(self):
self.assertIn("- TV_OS", workflow)
self.assertIn("/betaGroups/{group_id}/relationships/builds", script)
self.assertIn("processingState", script)
self.assertIn('required=True,\n choices=("IOS", "MAC_OS", "TV_OS", "VISION_OS")', script)

def test_app_store_screenshot_upload_workflow_uses_safe_defaults(self):
workflow = self.read(".github/workflows/upload-app-store-screenshots.yml")
Expand Down