Skip to content

Commit

Permalink
Remove record command (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
r0x0d authored Jan 6, 2025
1 parent 0a4349d commit ce7b6ac
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 195 deletions.
66 changes: 0 additions & 66 deletions command_line_assistant/commands/record.py

This file was deleted.

3 changes: 1 addition & 2 deletions command_line_assistant/initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys
from argparse import ArgumentParser, Namespace

from command_line_assistant.commands import history, query, record
from command_line_assistant.commands import history, query
from command_line_assistant.utils.cli import (
add_default_command,
create_argument_parser,
Expand All @@ -25,7 +25,6 @@ def register_subcommands() -> ArgumentParser:
# and call `register_subcommand()` on each one.
query.register_subcommand(commands_parser) # type: ignore
history.register_subcommand(commands_parser) # type: ignore
record.register_subcommand(commands_parser) # type: ignore

return parser

Expand Down
104 changes: 0 additions & 104 deletions tests/commands/test_record.py

This file was deleted.

23 changes: 0 additions & 23 deletions tests/test_initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def test_initialize_with_query_command(argv, stdin):
patch("sys.argv", argv),
patch("command_line_assistant.commands.query.register_subcommand"),
patch("command_line_assistant.commands.history.register_subcommand"),
patch("command_line_assistant.commands.record.register_subcommand"),
patch("command_line_assistant.initialize.read_stdin", lambda: stdin),
patch("argparse.ArgumentParser.parse_args") as mock_parse,
):
Expand All @@ -62,26 +61,6 @@ def test_initialize_with_history_command():
patch("sys.argv", ["c", "history", "--clear"]),
patch("command_line_assistant.commands.query.register_subcommand"),
patch("command_line_assistant.commands.history.register_subcommand"),
patch("command_line_assistant.commands.record.register_subcommand"),
patch("command_line_assistant.initialize.read_stdin", lambda: None),
patch("argparse.ArgumentParser.parse_args") as mock_parse,
):
mock_parse.return_value.func = mock_command
result = initialize()

assert result == 0
mock_command.assert_called_once()


def test_initialize_with_record_command():
"""Test initialize with record command"""
mock_command = Mock(return_value=MockCommand())

with (
patch("sys.argv", ["c", "record"]),
patch("command_line_assistant.commands.query.register_subcommand"),
patch("command_line_assistant.commands.history.register_subcommand"),
patch("command_line_assistant.commands.record.register_subcommand"),
patch("command_line_assistant.initialize.read_stdin", lambda: None),
patch("argparse.ArgumentParser.parse_args") as mock_parse,
):
Expand Down Expand Up @@ -139,7 +118,6 @@ def test_initialize_bad_stdin(capsys):
(["c"], "query"), # Default to query
(["c", "query"], "query"),
(["c", "history"], "history"),
(["c", "record"], "record"),
],
)
def test_initialize_command_selection(argv, expected_command):
Expand All @@ -151,7 +129,6 @@ def test_initialize_command_selection(argv, expected_command):
patch("command_line_assistant.initialize.read_stdin", lambda: None),
patch("command_line_assistant.commands.query.register_subcommand"),
patch("command_line_assistant.commands.history.register_subcommand"),
patch("command_line_assistant.commands.record.register_subcommand"),
patch("argparse.ArgumentParser.parse_args") as mock_parse,
):
mock_parse.return_value.func = mock_command
Expand Down

0 comments on commit ce7b6ac

Please sign in to comment.