def test_mpushbutton_init(qtbot, dayu_type, dayu_size, icon, text): """Test MPushButton set_dayu_size and set_dayu_type.""" widget = MPushButton(icon=MIcon(icon) if icon else icon, text=text) widget.set_dayu_size(dayu_size) widget.set_dayu_type(dayu_type) qtbot.addWidget(widget) assert widget.property('dayu_type') == dayu_type assert widget.property('dayu_size') == dayu_size
def test_chain_method(qtbot, attr, dayu_type): """Test MPushButton class methods.""" widget = MPushButton() if attr: getattr(widget, attr)() # widget.set_dayu_type(dayu_type) qtbot.addWidget(widget) assert widget.property("dayu_type") == dayu_type assert widget.property("dayu_size") == dayu_theme.default_size