mirror of
https://github.com/koloideal/Argenta.git
synced 2026-06-10 18:15:28 +03:00
fix
This commit is contained in:
@@ -24,7 +24,7 @@ class TestSystemHandlerNormalWork(unittest.TestCase):
|
|||||||
|
|
||||||
app = App()
|
app = App()
|
||||||
app.include_router(router)
|
app.include_router(router)
|
||||||
app.set_unknown_command_handler(lambda command: print(f'Unknown command: {command.get_trigger()}'))
|
app.unknown_command_handler = lambda command: print(f'Unknown command: {command.get_trigger()}')
|
||||||
app.start_polling()
|
app.start_polling()
|
||||||
|
|
||||||
output = mock_stdout.getvalue()
|
output = mock_stdout.getvalue()
|
||||||
@@ -32,7 +32,7 @@ class TestSystemHandlerNormalWork(unittest.TestCase):
|
|||||||
self.assertIn("\nUnknown command: help\n", output)
|
self.assertIn("\nUnknown command: help\n", output)
|
||||||
|
|
||||||
|
|
||||||
@patch("builtins.input", side_effect=["TeSt", "q"])
|
@patch("builtins.input", side_effect=["TeSt", "Q"])
|
||||||
@patch("sys.stdout", new_callable=io.StringIO)
|
@patch("sys.stdout", new_callable=io.StringIO)
|
||||||
def test_input_incorrect_command2(self, mock_stdout: _io.StringIO, magick_mock: MagicMock):
|
def test_input_incorrect_command2(self, mock_stdout: _io.StringIO, magick_mock: MagicMock):
|
||||||
router = Router()
|
router = Router()
|
||||||
@@ -43,7 +43,7 @@ class TestSystemHandlerNormalWork(unittest.TestCase):
|
|||||||
|
|
||||||
app = App(ignore_command_register=False)
|
app = App(ignore_command_register=False)
|
||||||
app.include_router(router)
|
app.include_router(router)
|
||||||
app.set_unknown_command_handler(lambda command: print(f'Unknown command: {command.get_trigger()}'))
|
app.unknown_command_handler = lambda command: print(f'Unknown command: {command.get_trigger()}')
|
||||||
app.start_polling()
|
app.start_polling()
|
||||||
|
|
||||||
output = mock_stdout.getvalue()
|
output = mock_stdout.getvalue()
|
||||||
@@ -117,7 +117,7 @@ class TestSystemHandlerNormalWork(unittest.TestCase):
|
|||||||
|
|
||||||
app = App()
|
app = App()
|
||||||
app.include_router(router)
|
app.include_router(router)
|
||||||
app.set_unknown_command_handler(lambda command: print(f'Unknown command: {command.get_trigger()}'))
|
app.unknown_command_handler = lambda command: print(f'Unknown command: {command.get_trigger()}')
|
||||||
app.start_polling()
|
app.start_polling()
|
||||||
|
|
||||||
output = mock_stdout.getvalue()
|
output = mock_stdout.getvalue()
|
||||||
@@ -140,7 +140,7 @@ class TestSystemHandlerNormalWork(unittest.TestCase):
|
|||||||
|
|
||||||
app = App()
|
app = App()
|
||||||
app.include_router(router)
|
app.include_router(router)
|
||||||
app.set_unknown_command_handler(lambda command: print(f'Unknown command: {command.get_trigger()}'))
|
app.unknown_command_handler = lambda command: print(f'Unknown command: {command.get_trigger()}')
|
||||||
app.start_polling()
|
app.start_polling()
|
||||||
|
|
||||||
output = mock_stdout.getvalue()
|
output = mock_stdout.getvalue()
|
||||||
@@ -159,7 +159,7 @@ class TestSystemHandlerNormalWork(unittest.TestCase):
|
|||||||
|
|
||||||
app = App()
|
app = App()
|
||||||
app.include_router(router)
|
app.include_router(router)
|
||||||
app.set_invalid_input_flags_handler(lambda command: print(f'Incorrect flag syntax: "{command}"'))
|
app.invalid_input_flags_handler = lambda command: print(f'Incorrect flag syntax: "{command}"')
|
||||||
app.start_polling()
|
app.start_polling()
|
||||||
|
|
||||||
output = mock_stdout.getvalue()
|
output = mock_stdout.getvalue()
|
||||||
@@ -178,7 +178,7 @@ class TestSystemHandlerNormalWork(unittest.TestCase):
|
|||||||
|
|
||||||
app = App()
|
app = App()
|
||||||
app.include_router(router)
|
app.include_router(router)
|
||||||
app.set_empty_command_handler(lambda: print('Empty input command'))
|
app.empty_input_command_handler = lambda: print('Empty input command')
|
||||||
app.start_polling()
|
app.start_polling()
|
||||||
|
|
||||||
output = mock_stdout.getvalue()
|
output = mock_stdout.getvalue()
|
||||||
@@ -197,7 +197,7 @@ class TestSystemHandlerNormalWork(unittest.TestCase):
|
|||||||
|
|
||||||
app = App()
|
app = App()
|
||||||
app.include_router(router)
|
app.include_router(router)
|
||||||
app.set_repeated_input_flags_handler(lambda command: print(f'Repeated input flags: "{command}"'))
|
app.repeated_input_flags_handler = lambda command: print(f'Repeated input flags: "{command}"')
|
||||||
app.start_polling()
|
app.start_polling()
|
||||||
|
|
||||||
output = mock_stdout.getvalue()
|
output = mock_stdout.getvalue()
|
||||||
|
|||||||
Reference in New Issue
Block a user