fix: correct mock paths

This commit is contained in:
Boris Arzentar 2025-10-14 13:37:42 +02:00
parent 77732d8698
commit 0df22fe703
No known key found for this signature in database
GPG key ID: D5CC274C784807B7
3 changed files with 7 additions and 8 deletions

View file

@ -40,11 +40,10 @@ Be careful with deletion operations as they are irreversible.
# Validate arguments
if not any(
[
hasattr(args, "dataset_name"),
hasattr(args, "dataset_id"),
hasattr(args, "data_id"),
hasattr(args, "user_id"),
hasattr(args, "all"),
getattr(args, "dataset_name", None),
getattr(args, "dataset_id", None),
getattr(args, "data_id", None),
getattr(args, "all", False) and getattr(args, "user_id", None),
]
):
fmt.error(

View file

@ -285,7 +285,7 @@ class TestDeleteCommand:
assert "all" in actions
assert "force" in actions
@patch("cognee.api.v1.datasets.datasets.delete_dataset")
@patch("cognee.datasets.delete_dataset")
@patch("cognee.modules.data.methods.get_deletion_counts.get_user")
@patch("cognee.cli.commands.delete_command.fmt.confirm")
@patch("cognee.cli.commands.delete_command.asyncio.run", side_effect=_mock_run)
@ -325,7 +325,7 @@ class TestDeleteCommand:
mock_confirm.assert_called_once_with(f"Delete dataset '{args.dataset_name}'?")
@patch("cognee.api.v1.datasets.datasets.delete_all")
@patch("cognee.datasets.delete_all")
@patch("cognee.cli.commands.delete_command.asyncio.run", side_effect=_mock_run)
def test_execute_delete_forced(self, mock_asyncio_run, delete_all_mock):
"""Test execute delete with force flag"""

View file

@ -382,7 +382,7 @@ class TestDeleteCommandEdgeCases:
@patch("cognee.cli.commands.delete_command.asyncio.run", side_effect=_mock_run)
@patch("cognee.cli.commands.delete_command.fmt.confirm")
@patch("cognee.api.v1.datasets.datasets.delete_all")
@patch("cognee.datasets.delete_all")
def test_delete_all_with_user_id(self, delete_all_mock, fmt_confirm_mock, async_run_mock):
"""Test delete command with both --all and --user-id"""
fmt_confirm_mock.return_value = True