Esempio n. 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
Esempio n. 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
Esempio n. 3
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]
Esempio n. 4
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]
Esempio n. 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"
Esempio n. 6
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"
Esempio n. 7
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
Esempio n. 8
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
Esempio n. 9
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']
Esempio n. 10
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"
Esempio n. 11
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"
Esempio n. 12
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']
Esempio n. 13
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()
Esempio n. 14
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()