Update tests/test_utils_shortcut.py
Run CI Tests / test (push) Successful in 1m5s

This commit is contained in:
2025-08-05 23:16:43 +02:00
parent caa971cdc8
commit 66dbb81eeb
+9 -6
View File
@@ -2,11 +2,17 @@ import pytest
import inspect
from unittest.mock import MagicMock, patch
from textwrap import dedent
from slic.utils.shortcut import Shortcut, as_shortcut, shortcuts, Registry
# Tests for Shortcut class
@pytest.fixture(autouse=True)
def reset_shortcuts():
# Reset shortcuts before each test
shortcuts._instance = None
yield
shortcuts._instance = None
# Tests for Shortcut class
class TestShortcutInitialization:
def test_init_with_custom_name(self):
# Verify initialization with custom name
@@ -44,10 +50,7 @@ def test_run_method(capsys):
# Verify Task properties
assert task.func == sample
assert task.func() == "ok"
assert task.hold is False
task = sc.run(hold=True)
assert task.hold is True
assert task.status == "done"
def test_repr_output():
# Test exact __repr__ format