Example #1
0
def test_should_return_uncheckedvalue_on_false():
    checkbox = QCheckBox()
    widget = CheckboxWidget(widget=checkbox)
    widget.config = config
    widget.setvalue('MyFalse')
    assert checkbox.isChecked() == False
    assert widget.value() == 'MyFalse'
Example #2
0
def test_should_set_config_checkedvalue_on_true():
    checkbox = QCheckBox()
    assert not checkbox.isChecked()
    widget = CheckboxWidget(widget=checkbox)
    widget.config = config
    widget.setvalue('MyTrue')
    assert checkbox.isChecked()
Example #3
0
def test_should_set_config_uncheckedvalue_on_false():
    checkbox = QCheckBox()
    checkbox.setChecked(True)
    assert checkbox.isChecked()
    widget = CheckboxWidget(widget=checkbox)
    widget.config = config
    widget.setvalue('MyFalse')
    assert not checkbox.isChecked()