From 722fada02c2fb4440e72f8e9448666e6d3ac8146 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 21 Jul 2026 13:34:52 +0100 Subject: [PATCH] Fix vs_create_tests for Click 8.3+ Click 8.3.0 seems to start prompting to confirm the default value when it didn't before, which caused test failures as seen in #2261. --- tests/CLI/modules/vs/vs_create_tests.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/tests/CLI/modules/vs/vs_create_tests.py b/tests/CLI/modules/vs/vs_create_tests.py index 06ea63d95..15f1315e5 100644 --- a/tests/CLI/modules/vs/vs_create_tests.py +++ b/tests/CLI/modules/vs/vs_create_tests.py @@ -382,10 +382,13 @@ def test_create_like(self, confirm_mock): } confirm_mock.return_value = True + # Prompts to confirm hostname, domain, and datacenter. + stdin = "\n\n\n" result = self.run_command(['vs', 'create', '--like=123', '--san', - '--billing=hourly']) + '--billing=hourly'], + stdin=stdin) self.assert_no_fail(result) self.assertIn('"guid": "1a2b3c-1701"', result.output) @@ -426,10 +429,13 @@ def test_create_like_tags(self, confirm_mock): } confirm_mock.return_value = True + # Prompts to confirm hostname, domain, and datacenter. + stdin = "\n\n\n" result = self.run_command(['vs', 'create', '--like=123', '--san', - '--billing=hourly']) + '--billing=hourly'], + stdin=stdin) self.assert_no_fail(result) self.assertIn('"guid": "1a2b3c-1701"', result.output) @@ -457,10 +463,13 @@ def test_create_like_image(self, confirm_mock): } confirm_mock.return_value = True + # Prompts to confirm hostname, domain, and datacenter. + stdin = "\n\n\n" result = self.run_command(['vs', 'create', '--like=123', '--san', - '--billing=hourly']) + '--billing=hourly'], + stdin=stdin) self.assert_no_fail(result) self.assertIn('"guid": "1a2b3c-1701"', result.output) @@ -499,7 +508,9 @@ def test_create_like_flavor(self, confirm_mock): } confirm_mock.return_value = True - result = self.run_command(['vs', 'create', '--like=123']) + # Prompts to confirm hostname, domain, and datacenter. + stdin = "\n\n\n" + result = self.run_command(['vs', 'create', '--like=123'], stdin=stdin) self.assert_no_fail(result) self.assertIn('"guid": "1a2b3c-1701"', result.output) @@ -540,7 +551,9 @@ def test_create_like_transient(self, confirm_mock): } confirm_mock.return_value = True - result = self.run_command(['vs', 'create', '--like=123']) + # Prompts to confirm hostname, domain, and datacenter. + stdin = "\n\n\n" + result = self.run_command(['vs', 'create', '--like=123'], stdin=stdin) self.assert_no_fail(result) self.assertIn('"guid": "1a2b3c-1701"', result.output)