From 048df7f0f920362899893a29253a78304b1a345c Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Tue, 26 Sep 2023 12:36:31 +0800 Subject: [PATCH] Fix typos Found via `typos --format brief` --- InquirerPy/base/simple.py | 12 ++++++------ InquirerPy/containers/spinner.py | 2 +- InquirerPy/containers/validation.py | 4 ++-- InquirerPy/prompts/checkbox.py | 2 +- InquirerPy/prompts/confirm.py | 2 +- InquirerPy/prompts/expand.py | 4 ++-- InquirerPy/prompts/filepath.py | 2 +- InquirerPy/prompts/fuzzy.py | 20 ++++++++++---------- InquirerPy/prompts/input.py | 4 ++-- InquirerPy/prompts/list.py | 10 +++++----- InquirerPy/prompts/number.py | 2 +- InquirerPy/prompts/rawlist.py | 2 +- InquirerPy/prompts/secret.py | 2 +- InquirerPy/resolver.py | 2 +- InquirerPy/utils.py | 26 +++++++++++++------------- docs/pages/faq.md | 2 +- docs/pages/kb.md | 2 +- docs/pages/prompt.md | 2 +- docs/pages/prompts/expand.md | 2 +- docs/pages/prompts/list.md | 2 +- docs/pages/raise_kbi.md | 4 ++-- tests/base/test_simple.py | 6 +++--- tests/prompts/test_list.py | 2 +- tests/prompts/test_number.py | 2 +- tests/test_resolver.py | 2 +- 25 files changed, 61 insertions(+), 61 deletions(-) diff --git a/InquirerPy/base/simple.py b/InquirerPy/base/simple.py index 94f3446..2cbfce6 100644 --- a/InquirerPy/base/simple.py +++ b/InquirerPy/base/simple.py @@ -106,15 +106,15 @@ def __init__( self._raise_kbi = not os.getenv( "INQUIRERPY_NO_RAISE_KBI", not raise_keyboard_interrupt ) - self._is_rasing_kbi = Condition(lambda: self._raise_kbi) + self._is_raising_kbi = Condition(lambda: self._raise_kbi) self._kb_maps = { "answer": [{"key": Keys.Enter}], "interrupt": [ - {"key": "c-c", "filter": self._is_rasing_kbi}, - {"key": "c-d", "filter": ~self._is_rasing_kbi}, + {"key": "c-c", "filter": self._is_raising_kbi}, + {"key": "c-d", "filter": ~self._is_raising_kbi}, ], - "skip": [{"key": "c-z"}, {"key": "c-c", "filter": ~self._is_rasing_kbi}], + "skip": [{"key": "c-z"}, {"key": "c-c", "filter": ~self._is_raising_kbi}], } self._kb_func_lookup = { "answer": [{"func": self._handle_enter}], @@ -205,7 +205,7 @@ def register_kb( """Keybinding registration decorator. This decorator wraps around the :meth:`prompt_toolkit.key_binding.KeyBindings.add` with - added feature to process `alt` realted keybindings. + added feature to process `alt` related keybindings. By default, `prompt_toolkit` doesn't process `alt` related keybindings, it requires `alt-ANY` to `escape` + `ANY`. @@ -215,7 +215,7 @@ def register_kb( filter: :class:`~prompt_toolkit.filter.Condition` to indicate if this keybinding should be active. Returns: - A decorator that should be applied to the function thats intended to be active when the keys + A decorator that should be applied to the function that's intended to be active when the keys are pressed. Examples: diff --git a/InquirerPy/containers/spinner.py b/InquirerPy/containers/spinner.py index 47be0a0..45c128c 100644 --- a/InquirerPy/containers/spinner.py +++ b/InquirerPy/containers/spinner.py @@ -25,7 +25,7 @@ class SPINNERS(NamedTuple): See Also: https://github.com/pavdmyt/yaspin/blob/master/yaspin/data/spinners.json - This only contains some basic ones thats ready to use. For more patterns, checkout the + This only contains some basic ones that's ready to use. For more patterns, checkout the URL above. Examples: diff --git a/InquirerPy/containers/validation.py b/InquirerPy/containers/validation.py index 32dca31..746545f 100644 --- a/InquirerPy/containers/validation.py +++ b/InquirerPy/containers/validation.py @@ -12,7 +12,7 @@ class ValidationWindow(ConditionalContainer): """Conditional `prompt_toolkit` :class:`~prompt_toolkit.layout.Window` that displays error. Args: - invalid_message: Error message to display when error occured. + invalid_message: Error message to display when error occurred. filter: Condition to display the error window. """ @@ -31,7 +31,7 @@ class ValidationFloat(Float): """:class:`~prompt_toolkit.layout.Float` wrapper around :class:`.ValidationWindow`. Args: - invalid_message: Error message to display when error occured. + invalid_message: Error message to display when error occurred. filter: Condition to display the error window. left: Distance to left. right: Distance to right. diff --git a/InquirerPy/prompts/checkbox.py b/InquirerPy/prompts/checkbox.py index 60f3bde..32062f7 100644 --- a/InquirerPy/prompts/checkbox.py +++ b/InquirerPy/prompts/checkbox.py @@ -148,7 +148,7 @@ class CheckboxPrompt(ListPrompt): cycle: Return to top item if hit bottom during navigation or vice versa. wrap_lines: Soft wrap question lines when question exceeds the terminal width. raise_keyboard_interrupt: Raise the :class:`KeyboardInterrupt` exception when `ctrl-c` is pressed. If false, the result - will be `None` and the question is skiped. + will be `None` and the question is skipped. mandatory: Indicate if the prompt is mandatory. If True, then the question cannot be skipped. mandatory_message: Error message to show when user attempts to skip mandatory prompt. session_result: Used internally for :ref:`index:Classic Syntax (PyInquirer)`. diff --git a/InquirerPy/prompts/confirm.py b/InquirerPy/prompts/confirm.py index 7cd71f7..71e98ae 100644 --- a/InquirerPy/prompts/confirm.py +++ b/InquirerPy/prompts/confirm.py @@ -56,7 +56,7 @@ class ConfirmPrompt(BaseSimplePrompt): reject_letter: Letter used to reject the prompt. A keybinding will be created for this letter. Default is `n` and pressing `n` will answer the prompt with value `False`. raise_keyboard_interrupt: Raise the :class:`KeyboardInterrupt` exception when `ctrl-c` is pressed. If false, the result - will be `None` and the question is skiped. + will be `None` and the question is skipped. mandatory: Indicate if the prompt is mandatory. If True, then the question cannot be skipped. mandatory_message: Error message to show when user attempts to skip mandatory prompt. session_result: Used internally for :ref:`index:Classic Syntax (PyInquirer)`. diff --git a/InquirerPy/prompts/expand.py b/InquirerPy/prompts/expand.py index e95f967..ca8aa9d 100644 --- a/InquirerPy/prompts/expand.py +++ b/InquirerPy/prompts/expand.py @@ -199,7 +199,7 @@ class ExpandPrompt(ListPrompt): A wrapper class around :class:`~prompt_toolkit.application.Application`. - Contains a list of chocies binded to a shortcut letter. + Contains a list of choices binded to a shortcut letter. The prompt can be expanded using `h` key. Args: @@ -257,7 +257,7 @@ class ExpandPrompt(ListPrompt): cycle: Return to top item if hit bottom during navigation or vice versa. wrap_lines: Soft wrap question lines when question exceeds the terminal width. raise_keyboard_interrupt: Raise the :class:`KeyboardInterrupt` exception when `ctrl-c` is pressed. If false, the result - will be `None` and the question is skiped. + will be `None` and the question is skipped. mandatory: Indicate if the prompt is mandatory. If True, then the question cannot be skipped. mandatory_message: Error message to show when user attempts to skip mandatory prompt. session_result: Used internally for :ref:`index:Classic Syntax (PyInquirer)`. diff --git a/InquirerPy/prompts/filepath.py b/InquirerPy/prompts/filepath.py index 97cce2b..95a8c32 100644 --- a/InquirerPy/prompts/filepath.py +++ b/InquirerPy/prompts/filepath.py @@ -122,7 +122,7 @@ class FilePathPrompt(InputPrompt): only_directories: Only complete directories. only_files: Only complete files. raise_keyboard_interrupt: Raise the :class:`KeyboardInterrupt` exception when `ctrl-c` is pressed. If false, the result - will be `None` and the question is skiped. + will be `None` and the question is skipped. mandatory: Indicate if the prompt is mandatory. If True, then the question cannot be skipped. mandatory_message: Error message to show when user attempts to skip mandatory prompt. session_result: Used internally for :ref:`index:Classic Syntax (PyInquirer)`. diff --git a/InquirerPy/prompts/fuzzy.py b/InquirerPy/prompts/fuzzy.py index 8f1a5b6..129b0f2 100644 --- a/InquirerPy/prompts/fuzzy.py +++ b/InquirerPy/prompts/fuzzy.py @@ -61,7 +61,7 @@ class InquirerPyFuzzyControl(InquirerPyUIListControl): """An :class:`~prompt_toolkit.layout.UIControl` class that displays a list of choices. - This only displays the chocies. The actual input buffer will be handled by a separate + This only displays the chices. The actual input buffer will be handled by a separate :class:`~prompt_toolkit.layout.BufferControl`. Reference the parameter definition in :class:`.FuzzyPrompt`. @@ -277,7 +277,7 @@ class FuzzyPrompt(BaseListPrompt): Refer to :ref:`pages/kb:Keybindings` documentation for more details. default: Set the default value in the search buffer. Different than other list type prompts, the `default` parameter tries to replicate what fzf does and - add the value in `default` to search buffer so it starts searching immediatelly. + add the value in `default` to search buffer so it starts searching immediately. Refer to :ref:`pages/dynamic:default` documentation for more details. qmark: Question mark symbol. Custom symbol that will be displayed infront of the question before its answered. amark: Answer mark symbol. Custom symbol that will be displayed infront of the question after its answered. @@ -316,7 +316,7 @@ class FuzzyPrompt(BaseListPrompt): cycle: Return to top item if hit bottom during navigation or vice versa. wrap_lines: Soft wrap question lines when question exceeds the terminal width. raise_keyboard_interrupt: Raise the :class:`KeyboardInterrupt` exception when `ctrl-c` is pressed. If false, the result - will be `None` and the question is skiped. + will be `None` and the question is skipped. mandatory: Indicate if the prompt is mandatory. If True, then the question cannot be skipped. mandatory_message: Error message to show when user attempts to skip mandatory prompt. session_result: Used internally for :ref:`index:Classic Syntax (PyInquirer)`. @@ -406,7 +406,7 @@ def __init__( else cast(Callable, default)(self._result) ) self._height_offset += 1 # search input - self._dimmension_height, self._dimmension_max_height = calculate_height( + self._dimension_height, self._dimension_max_height = calculate_height( height, max_height, height_offset=self.height_offset ) @@ -415,7 +415,7 @@ def __init__( pointer=pointer, marker=marker, current_text=self._get_current_text, - max_lines=self._dimmension_max_height, + max_lines=self._dimension_max_height, session_result=session_result, multiselect=multiselect, marker_pl=marker_pl, @@ -435,14 +435,14 @@ def __init__( ), ) - choice_height_dimmension = lambda: Dimension( - max=self._dimmension_max_height, - preferred=self._dimmension_height, + choice_height_dimension = lambda: Dimension( + max=self._dimension_max_height, + preferred=self._dimension_height, min=self.content_control._height if self.content_control._height > 0 else 1, ) self.choice_window = Window( content=self.content_control, - height=choice_height_dimmension, + height=choice_height_dimension, dont_extend_height=True, ) @@ -640,7 +640,7 @@ def _handle_enter(self, event: "KeyPressEvent") -> None: highlighted choice and return the value in a list. Otherwise, return all TAB choices as a list. - In normal scenario, reutrn the current highlighted choice. + In normal scenario, return the current highlighted choice. If current UI contains no choice due to filter, return None. """ diff --git a/InquirerPy/prompts/input.py b/InquirerPy/prompts/input.py index 1c79027..6b1b262 100644 --- a/InquirerPy/prompts/input.py +++ b/InquirerPy/prompts/input.py @@ -52,7 +52,7 @@ class InputPrompt(BaseSimplePrompt): Refer to :ref:`pages/prompts/input:Auto Completion` documentation for more details. multicolumn_complete: Change the auto-completion UI to a multi column display. multiline: Enable multiline edit. While multiline edit is active, pressing `enter` won't complete the answer. - and will create a new line. Use `esc` followd by `enter` to complete the question. + and will create a new line. Use `esc` followed by `enter` to complete the question. validate: Add validation to user input. Refer to :ref:`pages/validator:Validator` documentation for more details. invalid_message: Error message to display when user input is invalid. @@ -67,7 +67,7 @@ class InputPrompt(BaseSimplePrompt): Refer to :ref:`pages/kb:Keybindings` for more details. wrap_lines: Soft wrap question lines when question exceeds the terminal width. raise_keyboard_interrupt: Raise the :class:`KeyboardInterrupt` exception when `ctrl-c` is pressed. If false, the result - will be `None` and the question is skiped. + will be `None` and the question is skipped. is_password: Used internally for :class:`~InquirerPy.prompts.secret.SecretPrompt`. mandatory: Indicate if the prompt is mandatory. If True, then the question cannot be skipped. mandatory_message: Error message to show when user attempts to skip mandatory prompt. diff --git a/InquirerPy/prompts/list.py b/InquirerPy/prompts/list.py index acbda33..3871688 100644 --- a/InquirerPy/prompts/list.py +++ b/InquirerPy/prompts/list.py @@ -149,7 +149,7 @@ class ListPrompt(BaseListPrompt): cycle: Return to top item if hit bottom during navigation or vice versa. wrap_lines: Soft wrap question lines when question exceeds the terminal width. raise_keyboard_interrupt: Raise the :class:`KeyboardInterrupt` exception when `ctrl-c` is pressed. If false, the result - will be `None` and the question is skiped. + will be `None` and the question is skipped. mandatory: Indicate if the prompt is mandatory. If True, then the question cannot be skipped. mandatory_message: Error message to show when user attempts to skip mandatory prompt. session_result: Used internally for :ref:`index:Classic Syntax (PyInquirer)`. @@ -225,14 +225,14 @@ def __init__( session_result=session_result, ) self._show_cursor = show_cursor - self._dimmension_height, self._dimmension_max_height = calculate_height( + self._dimension_height, self._dimension_max_height = calculate_height( height, max_height, height_offset=self.height_offset ) main_content_window = Window( content=self.content_control, height=Dimension( - max=self._dimmension_max_height, - preferred=self._dimmension_height, + max=self._dimension_max_height, + preferred=self._dimension_height, ), dont_extend_height=True, ) @@ -303,7 +303,7 @@ def _handle_toggle_all(self, _, value: Optional[bool] = None) -> None: """Toggle all choice `enabled` status. Args: - value: Sepcify a value to toggle. + value: Specify a value to toggle. """ if not self._multiselect: return diff --git a/InquirerPy/prompts/number.py b/InquirerPy/prompts/number.py index 5efce26..a3f6b8d 100644 --- a/InquirerPy/prompts/number.py +++ b/InquirerPy/prompts/number.py @@ -90,7 +90,7 @@ class NumberPrompt(BaseComplexPrompt): Refer to :ref:`pages/kb:Keybindings` for more details. wrap_lines: Soft wrap question lines when question exceeds the terminal width. raise_keyboard_interrupt: Raise the :class:`KeyboardInterrupt` exception when `ctrl-c` is pressed. If false, the result - will be `None` and the question is skiped. + will be `None` and the question is skipped. mandatory: Indicate if the prompt is mandatory. If True, then the question cannot be skipped. mandatory_message: Error message to show when user attempts to skip mandatory prompt. session_result: Used internally for :ref:`index:Classic Syntax (PyInquirer)`. diff --git a/InquirerPy/prompts/rawlist.py b/InquirerPy/prompts/rawlist.py index 0de466d..d28a8f6 100644 --- a/InquirerPy/prompts/rawlist.py +++ b/InquirerPy/prompts/rawlist.py @@ -167,7 +167,7 @@ class RawlistPrompt(ListPrompt): cycle: Return to top item if hit bottom during navigation or vice versa. wrap_lines: Soft wrap question lines when question exceeds the terminal width. raise_keyboard_interrupt: Raise the :class:`KeyboardInterrupt` exception when `ctrl-c` is pressed. If false, the result - will be `None` and the question is skiped. + will be `None` and the question is skipped. mandatory: Indicate if the prompt is mandatory. If True, then the question cannot be skipped. mandatory_message: Error message to show when user attempts to skip mandatory prompt. session_result: Used internally for :ref:`index:Classic Syntax (PyInquirer)`. diff --git a/InquirerPy/prompts/secret.py b/InquirerPy/prompts/secret.py index cf7f3b2..85b2359 100644 --- a/InquirerPy/prompts/secret.py +++ b/InquirerPy/prompts/secret.py @@ -50,7 +50,7 @@ class SecretPrompt(InputPrompt): Refer to :ref:`pages/kb:Keybindings` for more details. wrap_lines: Soft wrap question lines when question exceeds the terminal width. raise_keyboard_interrupt: Raise the :class:`KeyboardInterrupt` exception when `ctrl-c` is pressed. If false, the result - will be `None` and the question is skiped. + will be `None` and the question is skipped. mandatory: Indicate if the prompt is mandatory. If True, then the question cannot be skipped. mandatory_message: Error message to show when user attempts to skip mandatory prompt. session_result: Used internally for :ref:`index:Classic Syntax (PyInquirer)`. diff --git a/InquirerPy/resolver.py b/InquirerPy/resolver.py index ea409bc..1aaf2cd 100644 --- a/InquirerPy/resolver.py +++ b/InquirerPy/resolver.py @@ -142,7 +142,7 @@ def prompt( vi_mode: Use vim keybindings for the prompt instead of the default emacs keybindings. Refer to :ref:`pages/kb:Keybindings` for more info. raise_keyboard_interrupt: Raise the :class:`KeyboardInterrupt` exception when `ctrl-c` is pressed. If false, the result - will be `None` and the question is skiped. + will be `None` and the question is skipped. keybindings: List of custom :ref:`pages/kb:Keybindings` to apply. Refer to documentation for more info. style_override: Override all default styles. When providing any style customisation, all default styles are removed when this is True. diff --git a/InquirerPy/utils.py b/InquirerPy/utils.py index 8e2b62f..6942c86 100644 --- a/InquirerPy/utils.py +++ b/InquirerPy/utils.py @@ -205,35 +205,35 @@ def calculate_height( _, term_lines = shutil.get_terminal_size() term_lines = term_lines if not height: - dimmension_height = None + dimension_height = None else: if isinstance(height, str): height = height.replace("%", "") height = int(height) - dimmension_height = ( + dimension_height = ( math.floor(term_lines * (height / 100)) - height_offset ) else: - dimmension_height = height + dimension_height = height if not max_height: max_height = "70%" if not height else "100%" if isinstance(max_height, str): max_height = max_height.replace("%", "") max_height = int(max_height) - dimmension_max_height = ( + dimension_max_height = ( math.floor(term_lines * (max_height / 100)) - height_offset ) else: - dimmension_max_height = max_height - - if dimmension_height and dimmension_height > dimmension_max_height: - dimmension_height = dimmension_max_height - if dimmension_height and dimmension_height <= 0: - dimmension_height = 1 - if dimmension_max_height <= 0: - dimmension_max_height = 1 - return dimmension_height, dimmension_max_height + dimension_max_height = max_height + + if dimension_height and dimension_height > dimension_max_height: + dimension_height = dimension_max_height + if dimension_height and dimension_height <= 0: + dimension_height = 1 + if dimension_max_height <= 0: + dimension_max_height = 1 + return dimension_height, dimension_max_height except ValueError: raise InvalidArgument( diff --git a/docs/pages/faq.md b/docs/pages/faq.md index 09595d4..6c14baf 100644 --- a/docs/pages/faq.md +++ b/docs/pages/faq.md @@ -12,7 +12,7 @@ as a list is not ideal in a lot of scenarios. Use `transformer` parameter to cus ## How can I do unittest when using `InquirerPy`? ```{tip} -Since `InquirerPy` module itself is tested, there's no need to mock any futher/deeper than the API entrypoint (`prompt` and `inquirer`). +Since `InquirerPy` module itself is tested, there's no need to mock any further/deeper than the API entrypoint (`prompt` and `inquirer`). ``` For {ref}`index:Classic Syntax (PyInquirer)` user, it would be just a direct mock on the {ref}`pages/prompt:prompt` function. diff --git a/docs/pages/kb.md b/docs/pages/kb.md index ee425bf..19cf1f7 100644 --- a/docs/pages/kb.md +++ b/docs/pages/kb.md @@ -192,7 +192,7 @@ for more information about limitations and other advanced topics. #### filter Each keybinding also takes another **optional** key called `filter` which can be used to determine if certain keys should be enabled/disabled. -The `filter` key can be either a boolean or a `prompt_toolkit` [Conditon](https://python-prompt-toolkit.readthedocs.io/en/master/pages/advanced_topics/filters.html#filters). +The `filter` key can be either a boolean or a `prompt_toolkit` [Condition](https://python-prompt-toolkit.readthedocs.io/en/master/pages/advanced_topics/filters.html#filters). **bool** diff --git a/docs/pages/prompt.md b/docs/pages/prompt.md index dde732d..55d5d3d 100644 --- a/docs/pages/prompt.md +++ b/docs/pages/prompt.md @@ -117,7 +117,7 @@ for their specific options/parameters. - mandatory (`bool`): Indicate if the prompt is mandatory. If True, then the question cannot be skipped. - mandatory_message (`str`): Error message to show when user attempts to skip mandatory prompt. - raise_keyboard_interrupt (`bool`): Raise the {class}`KeyboardInterrupt` exception when `ctrl-c` is pressed. If false, the result - will be `None` and the question is skiped. + will be `None` and the question is skipped. ## Asynchronous execution diff --git a/docs/pages/prompts/expand.md b/docs/pages/prompts/expand.md index b9130a5..5b46afd 100644 --- a/docs/pages/prompts/expand.md +++ b/docs/pages/prompts/expand.md @@ -40,7 +40,7 @@ expansion key or navigation key. ```{tip} It is recommended to use {class}`~InquirerPy.prompts.expand.ExpandChoice` to create choices for expand prompt. -However if you prefer {class}`dict` chocies, in addition to the 2 required keys `name` and `value`, an additional +However if you prefer {class}`dict` choices, in addition to the 2 required keys `name` and `value`, an additional key called `key` is also required. The value from `key` should be a single char and will be binded to the choice. Pressing the value will jump to the choice. ``` diff --git a/docs/pages/prompts/list.md b/docs/pages/prompts/list.md index 9b3cd1e..b482436 100644 --- a/docs/pages/prompts/list.md +++ b/docs/pages/prompts/list.md @@ -124,7 +124,7 @@ choices = [ ] result = inquirer.select( - message="Selct one:", choices=choices, multiselect=True + message="Select one:", choices=choices, multiselect=True ).execute() ``` diff --git a/docs/pages/raise_kbi.md b/docs/pages/raise_kbi.md index aabbe5a..d1a0186 100644 --- a/docs/pages/raise_kbi.md +++ b/docs/pages/raise_kbi.md @@ -23,7 +23,7 @@ Default keybinding for skip is `ctrl-z`. ```` When `mandator=False` for a prompt, user will be able to skip the prompt. In the case of a skip attempt when -`mandatory=True`, an error message will be displayed using the parameter `madatory_message="Mandatory prompt"`. +`mandatory=True`, an error message will be displayed using the parameter `mandatory_message="Mandatory prompt"`.
Classic Syntax @@ -141,7 +141,7 @@ If you are already customising `skip` and `interrupt` using [keybindings](#keybi ``` ```{tip} -`raise_keyboard_interrupt` is bascially a managed way of customising keybindings similar to parameter `vi_mode`. +`raise_keyboard_interrupt` is basically a managed way of customising keybindings similar to parameter `vi_mode`. ``` ```{tip} diff --git a/tests/base/test_simple.py b/tests/base/test_simple.py index 257200c..e352324 100644 --- a/tests/base/test_simple.py +++ b/tests/base/test_simple.py @@ -127,9 +127,9 @@ def test_keybinding_factory(self, mocked_kb): prompt = InputPrompt(message="") mocked_kb.assert_has_calls([call(Keys.Enter, filter=ANY)]) mocked_kb.assert_has_calls([call(Keys.Escape, Keys.Enter, filter=ANY)]) - mocked_kb.assert_has_calls([call("c-c", filter=prompt._is_rasing_kbi)]) - mocked_kb.assert_has_calls([call("c-d", filter=~prompt._is_rasing_kbi)]) - mocked_kb.assert_has_calls([call("c-c", filter=~prompt._is_rasing_kbi)]) + mocked_kb.assert_has_calls([call("c-c", filter=prompt._is_raising_kbi)]) + mocked_kb.assert_has_calls([call("c-d", filter=~prompt._is_raising_kbi)]) + mocked_kb.assert_has_calls([call("c-c", filter=~prompt._is_raising_kbi)]) mocked_kb.reset_mock() prompt = partial( InputPrompt, message="", keybindings={"hello": [{"key": "c-d"}]} diff --git a/tests/prompts/test_list.py b/tests/prompts/test_list.py index 55e64b6..796bfff 100644 --- a/tests/prompts/test_list.py +++ b/tests/prompts/test_list.py @@ -177,6 +177,6 @@ def test_prompt_execute(self, mocked_run): try: result = prompt.execute(raise_keyboard_interrupt=False) except KeyboardInterrupt: - self.assertFalse(prompt._is_rasing_kbi()) + self.assertFalse(prompt._is_raising_kbi()) else: self.fail("should raise kbi") diff --git a/tests/prompts/test_number.py b/tests/prompts/test_number.py index 4b73236..b48d28a 100644 --- a/tests/prompts/test_number.py +++ b/tests/prompts/test_number.py @@ -28,7 +28,7 @@ def setUp(self) -> None: self.prompt._on_rendered(None) self.float_prompt._on_rendered(None) - def test_contructor(self) -> None: + def test_constructor(self) -> None: self.assertFalse(self.prompt._float) self.assertEqual(self.prompt._default, 1) self.assertFalse(self.prompt._is_float()) diff --git a/tests/test_resolver.py b/tests/test_resolver.py index 2b6d8ff..a258836 100644 --- a/tests/test_resolver.py +++ b/tests/test_resolver.py @@ -429,7 +429,7 @@ def test_custom_kb(self, mocked_kb, mocked_execute1, mocked_execute2): @patch.object(FuzzyPrompt, "__init__") @patch.object(FuzzyPrompt, "execute") - def test_resolver_when_not_poped(self, mocked_execute, mocked_init): + def test_resolver_when_not_popped(self, mocked_execute, mocked_init): mocked_init.return_value = None mocked_execute.return_value = 1 questions = [