Skip to content

Commit

Permalink
fix test.
Browse files Browse the repository at this point in the history
  • Loading branch information
ppwadhwa committed Nov 21, 2022
1 parent 47eb39f commit 02a0d03
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/test_collapsible.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
"""A test module for testing collapsible"""

import pytest
from napari._qt.qt_resources import QColoredSVGIcon
from fonticon_fa5 import FA5S
from qtpy.QtCore import QEasingCurve
from qtpy.QtWidgets import QPushButton

from superqt import QCollapsible
from superqt.fonticon import icon


def test_checked_initialization(qtbot):
Expand Down Expand Up @@ -93,12 +94,12 @@ def test_changing_text(qtbot):
def test_setting_icon(qtbot):
"""Test setting icon for toggle button."""

icon1 = QColoredSVGIcon.from_resources("right_arrow")
icon2 = QColoredSVGIcon.from_resources("right_arrow")
icon1 = icon(FA5S.smile, color="white")
icon2 = icon(FA5S.frown, color="white")

wdg = QCollapsible("test", expandedIcon=icon2, collapsedIcon=icon1)
assert wdg._EXPANDED == icon2
assert wdg._COLLAPSED == icon1
wdg = QCollapsible("test", expandedIcon=icon1, collapsedIcon=icon2)
assert wdg._EXPANDED == icon1
assert wdg._COLLAPSED == icon2

icon2 = wdg._convert_symbol_to_icon("*")
wdg.setCollapsedIcon(icon=icon2)
Expand Down

0 comments on commit 02a0d03

Please sign in to comment.