Example #1
0
def test_no_value_returns_none():
    # WAT?!
    widget = OptionWidget().createWidget()
    option = OptionWidget(widget=widget)
    option.initWidget(widget, {})
    option.config = config
    assert option.value() is None
Example #2
0
def test_no_value_returns_none():
    # WAT?!
    widget = OptionWidget().createWidget()
    option = OptionWidget(widget=widget)
    option.initWidget(widget)
    option.config = config
    assert option.value() is None
Example #3
0
def test_single_option_returns_single_value():
    # WAT?!
    widget = OptionWidget().createWidget()
    option = OptionWidget(widget=widget)
    option.initWidget(widget)
    option.config = config
    option.setvalue("1")
    assert option.value() == "1"
Example #4
0
def test_no_value_returns_none_multi():
    # WAT?!
    widget = OptionWidget().createWidget()
    option = OptionWidget(widget=widget)
    option.initWidget(widget, {})
    config['multi'] = True
    option.config = config
    assert option.value() is None
Example #5
0
def test_single_option_returns_single_value():
    # WAT?!
    widget = OptionWidget().createWidget()
    option = OptionWidget(widget=widget)
    option.initWidget(widget, {})
    option.config = config
    option.setvalue("1")
    assert option.value() == "1"
Example #6
0
def test_no_value_returns_none_multi():
    # WAT?!
    widget = OptionWidget().createWidget()
    option = OptionWidget(widget=widget)
    option.initWidget(widget)
    config['multi'] = True
    option.config = config
    assert option.value() is None
Example #7
0
def test_create_button_for_each_item():
    # WAT?!
    widget = OptionWidget().createWidget()
    option = OptionWidget(widget=widget)
    option.initWidget(widget)
    option.config = config
    assert len(option.buttons) == 2
    for button in option.buttons:
        assert button.text() in items['items']
Example #8
0
def test_multi_returns_list():
    # WAT?!
    widget = OptionWidget().createWidget()
    option = OptionWidget(widget=widget)
    option.initWidget(widget)
    config['multi'] = True
    option.config = config
    option.setvalue("1;2")
    assert option.value() == "1;2"
Example #9
0
def test_multi_returns_list():
    # WAT?!
    widget = OptionWidget().createWidget()
    option = OptionWidget(widget=widget)
    option.initWidget(widget, {})
    config['multi'] = True
    option.config = config
    option.setvalue("1;2")
    assert option.value() == "1;2"
Example #10
0
def test_create_button_for_each_item():
    # WAT?!
    widget = OptionWidget().createWidget()
    option = OptionWidget(widget=widget)
    option.initWidget(widget)
    option.config = config
    assert len(option.buttons) == 2
    for button in option.buttons:
        assert button.text() in items['items']
Example #11
0
def test_create_button_with_color():
    widget = OptionWidget().createWidget()
    option = OptionWidget(widget=widget)
    option.initWidget(widget, {})
    option.config = config_color
    assert len(option.buttons) == 2
    for count, button in enumerate(option.buttons):
        item = items_color['items'][count]
        parts = item.split(";")
        ## Part[2] is the #hex color
        assert parts[2] in button.styleSheet()
Example #12
0
def test_create_button_with_color():
    widget = OptionWidget().createWidget()
    option = OptionWidget(widget=widget)
    option.initWidget(widget, {})
    option.config = config_color
    assert len(option.buttons) == 2
    for count, button in enumerate(option.buttons):
        item = items_color['items'][count]
        parts = item.split(";")
        ## Part[2] is the #hex color
        assert parts[2] in button.styleSheet()
Example #13
0
def test_create_button_for_each_item():
    # WAT?!
    widget = OptionWidget().createWidget()
    option = OptionWidget(widget=widget)
    option.initWidget(widget, {})
    option.config = config
    assert len(option.buttons) == 2
    for count, button in enumerate(option.buttons):
        assert button.text() in items['items'][count]
    widget = OptionWidget().createWidget()
    option = OptionWidget(widget=widget)
    option.initWidget(widget, {"wrap": 1})
    option.config = config
    assert len(option.buttons) == 2
    for count, button in enumerate(option.buttons):
        assert button.text() in items['items'][count]
Example #14
0
def test_create_button_for_each_item():
    # WAT?!
    widget = OptionWidget().createWidget()
    option = OptionWidget(widget=widget)
    option.initWidget(widget, {})
    option.config = config
    assert len(option.buttons) == 2
    for count, button in enumerate(option.buttons):
        assert button.text() in items['items'][count]
    widget = OptionWidget().createWidget()
    option = OptionWidget(widget=widget)
    option.initWidget(widget, {"wrap": 1})
    option.config = config
    assert len(option.buttons) == 2
    for count, button in enumerate(option.buttons):
        assert button.text() in items['items'][count]