Skip to content

Commit c488828

Browse files
committed
Removed obsolete test code.
1 parent db30ea3 commit c488828

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

tests/test_pt_utils.py

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from unittest.mock import Mock
66

77
import pytest
8-
from prompt_toolkit.buffer import Buffer
98
from prompt_toolkit.document import Document
109
from prompt_toolkit.formatted_text import (
1110
ANSI,
@@ -23,21 +22,9 @@
2322
from cmd2.parsing import Statement
2423

2524

26-
class MockSession:
27-
"""Simulates a prompt_toolkit PromptSession."""
28-
29-
def __init__(self):
30-
# Contains the CLI text and cursor position
31-
self.buffer = Buffer()
32-
33-
# Mock the app structure: session -> app -> current_buffer
34-
self.app = Mock()
35-
self.app.current_buffer = self.buffer
36-
37-
3825
# Mock for cmd2.Cmd
3926
class MockCmd:
40-
def __init__(self):
27+
def __init__(self) -> None:
4128
# Return empty completions by default
4229
self.complete = Mock(return_value=cmd2.Completions())
4330

@@ -50,14 +37,13 @@ def __init__(self):
5037
self.aliases = {}
5138
self.macros = {}
5239
self.all_commands = []
53-
self.session = MockSession()
5440

55-
def get_all_commands(self):
41+
def get_all_commands(self) -> list[str]:
5642
return self.all_commands
5743

5844

5945
@pytest.fixture
60-
def mock_cmd_app():
46+
def mock_cmd_app() -> MockCmd:
6147
return MockCmd()
6248

6349

0 commit comments

Comments
 (0)