From 7ffbdda7ea105782a5e4d603838c247df07d707e Mon Sep 17 00:00:00 2001 From: Sebastian Lenzlinger Date: Wed, 8 May 2024 02:56:49 +0200 Subject: [PATCH] Add test case to add-device subcommand --- code/tests/subcommands/test_add_device.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/tests/subcommands/test_add_device.py b/code/tests/subcommands/test_add_device.py index 1c82ec9..d2b4044 100644 --- a/code/tests/subcommands/test_add_device.py +++ b/code/tests/subcommands/test_add_device.py @@ -32,7 +32,8 @@ class TestDeviceSetup(unittest.TestCase): expected_file = self.test_dir / DEVICE_METADATA_FILE self.assertTrue(expected_file.exists()), f'Expected file not created: {expected_file}' - def test_device_setup(self): + @patch('builtins.input', side_effect=['y']) # need mock_input else wont work + def test_device_setup(self, mock_input): sys.argv = ['__main__.py', 'add', '--root_dir', str(self.test_dir), '--name', 'iPhone 14'] main() expected_file = self.test_dir / DEVICE_METADATA_FILE