Improved Command class management.

This commit is contained in:
2025-12-19 21:12:55 +01:00
parent b26abc4257
commit 1347f12618
23 changed files with 349 additions and 169 deletions

View File

@@ -34,13 +34,13 @@ def rt(user):
class TestingCommand:
def test_i_can_trigger_a_command(self, user):
command = Command('test', 'TestingCommand', None, new_value, "this is my new value")
command = Command('test', 'TestingCommand', None, new_value, args=["this is my new value"])
testable = TestableElement(user, mk.button('button', command))
testable.click()
assert user.get_content() == "this is my new value"
def test_error_is_raised_when_command_is_not_found(self, user):
command = Command('test', 'TestingCommand', None, new_value, "this is my new value")
command = Command('test', 'TestingCommand', None, new_value, args=["this is my new value"])
CommandsManager.reset()
testable = TestableElement(user, mk.button('button', command))
@@ -50,7 +50,7 @@ class TestingCommand:
assert "not found." in str(exc_info.value)
def test_i_can_play_a_complex_scenario(self, user, rt):
command = Command('test', 'TestingCommand', None, new_value, "this is my new value")
command = Command('test', 'TestingCommand', None, new_value, args=["this is my new value"])
@rt('/')
def get(): return mk.button('button', command)