From 4b6a9d92396463ced7aedb1cde83652e886aef81 Mon Sep 17 00:00:00 2001 From: Andrew Langmeier Date: Sat, 27 Jan 2024 23:35:58 -0500 Subject: [PATCH] Add back in accidentally deleted function --- app/pages/first_steps.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/app/pages/first_steps.py b/app/pages/first_steps.py index 02b3efd..9b47dae 100644 --- a/app/pages/first_steps.py +++ b/app/pages/first_steps.py @@ -142,7 +142,26 @@ def futures_try_int_input(mocked_input_ret): print(my_number * 2) # END - +def conditions_names(mocked_input_ret): + """ + >>> Codeblocks.conditions_names('Joshua') + Greetings. Would you like to play a game? + >>> Codeblocks.conditions_names('Dave') + I'm sorry, Dave. I'm afraid I still can't open the podbay doors. + >>> Codeblocks.conditions_names('foobarbaz') + Hello, foobarbaz + """ + with patch('builtins.input') as input: + input.return_value = mocked_input_ret + # START + user_input = input('What\'s your name?') + if user_input == 'Joshua': + print('Greetings. Would you like to play a game?') + elif user_input == 'Dave': + print("I'm sorry, Dave. I'm afraid I still can't open the podbay doors.") + else: + print('Hello, ' + user_input) + # END # pylint: disable=using-constant-test