This commit is contained in:
@@ -88,11 +88,11 @@ class TestLink(unittest.TestCase):
|
||||
callback=self.mock_callback,
|
||||
params=params
|
||||
)
|
||||
|
||||
|
||||
result = link.execute()
|
||||
|
||||
# Should call callback with location and params
|
||||
self.mock_callback.assert_called_once_with("/api/save", action="save", id=123)
|
||||
|
||||
# Should call callback with location, point (None when not provided), and params
|
||||
self.mock_callback.assert_called_once_with("/api/save", None, action="save", id=123)
|
||||
self.assertEqual(result, "callback_result")
|
||||
|
||||
def test_function_link_execution(self):
|
||||
@@ -104,11 +104,11 @@ class TestLink(unittest.TestCase):
|
||||
callback=self.mock_callback,
|
||||
params=params
|
||||
)
|
||||
|
||||
|
||||
result = link.execute()
|
||||
|
||||
# Should call callback with location and params
|
||||
self.mock_callback.assert_called_once_with("save_document", data="test")
|
||||
|
||||
# Should call callback with location, point (None when not provided), and params
|
||||
self.mock_callback.assert_called_once_with("save_document", None, data="test")
|
||||
self.assertEqual(result, "callback_result")
|
||||
|
||||
def test_api_link_without_callback(self):
|
||||
@@ -204,11 +204,11 @@ class TestButton(unittest.TestCase):
|
||||
"""Test executing enabled button."""
|
||||
params = {"data": "test_data"}
|
||||
button = Button("Test", self.mock_callback, params=params, enabled=True)
|
||||
|
||||
|
||||
result = button.execute()
|
||||
|
||||
# Should call callback with params
|
||||
self.mock_callback.assert_called_once_with(data="test_data")
|
||||
|
||||
# Should call callback with point (None when not provided) and params
|
||||
self.mock_callback.assert_called_once_with(None, data="test_data")
|
||||
self.assertEqual(result, "button_clicked")
|
||||
|
||||
def test_button_execute_disabled(self):
|
||||
|
||||
Reference in New Issue
Block a user