CAM: Fix Gui test for ToolBitBrowserWidget
This commit is contained in:
@@ -41,6 +41,9 @@ class TestToolBitBrowserWidget(PathTestWithAssets):
|
||||
self.widget = ToolBitBrowserWidget(self.assets)
|
||||
|
||||
def test_initial_fetch(self):
|
||||
# Simulate expose to trigger initial fetch
|
||||
self.widget.showEvent(None)
|
||||
|
||||
# Verify that the list widget is populated after initialization
|
||||
# The default test assets include some toolbits.
|
||||
self.assertGreater(self.widget._tool_list_widget.count(), 0)
|
||||
@@ -79,6 +82,9 @@ class TestToolBitBrowserWidget(PathTestWithAssets):
|
||||
if is_expected:
|
||||
expected_visible_uris.add(str(tb.get_uri()))
|
||||
|
||||
# Simulate expose to trigger initial fetch
|
||||
self.widget.showEvent(None)
|
||||
|
||||
actual_visible_uris = set()
|
||||
for i in range(self.widget._tool_list_widget.count()):
|
||||
item = self.widget._tool_list_widget.item(i)
|
||||
|
||||
@@ -133,9 +133,9 @@ class ToolBitBrowserWidget(QtGui.QWidget):
|
||||
),
|
||||
)
|
||||
self._sort_assets()
|
||||
self._trigger_fetch()
|
||||
finally:
|
||||
self._is_fetching = False
|
||||
self._trigger_fetch()
|
||||
|
||||
def _sort_assets(self):
|
||||
"""Sorts the in-memory assets based on the current sort key."""
|
||||
|
||||
Reference in New Issue
Block a user