summaryrefslogtreecommitdiff
path: root/tests/migrations
diff options
context:
space:
mode:
authorAdam Johnson <me@adamj.eu>2024-11-18 14:41:24 +0100
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2024-11-18 15:15:44 +0100
commit3434fab758c5a293c8f376bb5990af6acbf89e32 (patch)
tree1379128a14d0394a6b1d4b39bc9d333b9f36910e /tests/migrations
parentca113adbae1cc2129256f51ac71e8aed2a381576 (diff)
Refs #35882 -- Added test for migration questioner KeyboardInterrupt.
Diffstat (limited to 'tests/migrations')
-rw-r--r--tests/migrations/test_questioner.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/migrations/test_questioner.py b/tests/migrations/test_questioner.py
index c1aebcb224..a212fbf65f 100644
--- a/tests/migrations/test_questioner.py
+++ b/tests/migrations/test_questioner.py
@@ -66,6 +66,11 @@ class QuestionerHelperMethodsTests(SimpleTestCase):
self.questioner._ask_default()
self.assertIn("Invalid input: ", self.prompt.getvalue())
+ @mock.patch("builtins.input", side_effect=[KeyboardInterrupt()])
+ def test_questioner_no_default_keyboard_interrupt(self, mock_input):
+ with self.assertRaises(KeyboardInterrupt):
+ self.questioner._ask_default()
+
@mock.patch("builtins.input", side_effect=["", "n"])
def test_questioner_no_default_no_user_entry_boolean(self, mock_input):
value = self.questioner._boolean_input("Proceed?")