possibility to have a default as multi
This commit is contained in:
@ -50,12 +50,12 @@ def test_attribute_access_with_multi():
|
||||
config.string = ["foo", "bar"]
|
||||
assert config.string == ["foo", "bar"]
|
||||
|
||||
def test_attribute_access_with_multi():
|
||||
s = StrOption("string", "", default="string", multi=True)
|
||||
descr = OptionDescription("options", "", [s])
|
||||
config = Config(descr)
|
||||
config.string = ["foo", "bar"]
|
||||
assert config.string == ["foo", "bar"]
|
||||
#def test_attribute_access_with_multi2():
|
||||
# s = StrOption("string", "", default="string", multi=True)
|
||||
# descr = OptionDescription("options", "", [s])
|
||||
# config = Config(descr)
|
||||
# config.string = ["foo", "bar"]
|
||||
# assert config.string == ["foo", "bar"]
|
||||
|
||||
def test_multi_with_requires():
|
||||
s = StrOption("string", "", default="string", multi=True)
|
||||
@ -145,7 +145,7 @@ def test_multi_with_requires_with_disabled_in_another_group():
|
||||
|
||||
def test_multi_with_requires_that_is_multi():
|
||||
s = StrOption("string", "", default="string", multi=True)
|
||||
intoption = IntOption('int', 'Test int option', default=[0, 0], multi=True)
|
||||
intoption = IntOption('int', 'Test int option', default=0, multi=True)
|
||||
stroption = StrOption('str', 'Test string option', default="abc",
|
||||
requires=[('int', [1, 1], 'hide')], multi=True)
|
||||
descr = OptionDescription("options", "", [s, intoption, stroption])
|
||||
@ -156,7 +156,7 @@ def test_multi_with_requires_that_is_multi():
|
||||
assert stroption._is_hidden()
|
||||
|
||||
def test_multi_with_bool():
|
||||
s = BoolOption("bool", "", default=[False], multi=True)
|
||||
s = BoolOption("bool", "", default=False, multi=True)
|
||||
descr = OptionDescription("options", "", [s])
|
||||
config = Config(descr)
|
||||
assert descr.bool.multi == True
|
||||
@ -165,14 +165,14 @@ def test_multi_with_bool():
|
||||
assert config.bool == [True, False]
|
||||
|
||||
def test_multi_with_bool_two():
|
||||
s = BoolOption("bool", "", default=[False], multi=True)
|
||||
s = BoolOption("bool", "", default=False, multi=True)
|
||||
descr = OptionDescription("options", "", [s])
|
||||
config = Config(descr)
|
||||
assert descr.bool.multi == True
|
||||
raises(ConfigError, "config.bool = True")
|
||||
|
||||
def test_choice_access_with_multi():
|
||||
ch = ChoiceOption("t1", "", ["a", "b"], default=["a", "a", "a"], multi=True)
|
||||
ch = ChoiceOption("t1", "", ["a", "b"], default="a", multi=True)
|
||||
descr = OptionDescription("options", "", [ch])
|
||||
config = Config(descr)
|
||||
config.t1 = ["a", "b", "a", "b"]
|
||||
|
Reference in New Issue
Block a user