Skip to content

Commit

Permalink
TST:Comments Added
Browse files Browse the repository at this point in the history
  • Loading branch information
ashdriod committed Nov 30, 2023
1 parent 16c6963 commit ca90ce2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/test_main_window_actions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 1. Direct calls in tests isolate specific functionalities for focused, independent testing of components.
# 2. Triggering actions and using mocks are crucial for integration testing, ensuring components interact correctly.
# 3. Mocking and action triggering simulate real-world user interactions and application responses.
# 4. Separating tests for direct calls and action triggers aids in maintaining clear, organized test structures.
# 5. This approach enhances test suite readability and makes it easier to understand and update.



import pytest
from unittest.mock import patch, MagicMock, AsyncMock
from gi.repository import Gtk, Gio, GLib
Expand Down Expand Up @@ -84,4 +92,6 @@ async def test_do_get_item_action_trigger(app):
get_item_action.activate(dest_file_variant)

# Assert that do_get_item was called once
mock_do_get_item.assert_called_once_with(get_item_action, dest_file_variant)
mock_do_get_item.assert_called_once_with(get_item_action, dest_file_variant)


0 comments on commit ca90ce2

Please sign in to comment.