simplify tiramisu/option/optiondescription.py
This commit is contained in:
@ -50,7 +50,7 @@ def _is_same_opt(opt1, opt2):
|
||||
|
||||
def test_od_not_list():
|
||||
b = BoolOption('bool', '', multi=True)
|
||||
raises(ValueError, "OptionDescription('od', '', b)")
|
||||
raises(AssertionError, "OptionDescription('od', '', b)")
|
||||
|
||||
|
||||
def test_str():
|
||||
|
@ -88,7 +88,7 @@ def test_deref_option_cache():
|
||||
return
|
||||
b = BoolOption('b', '')
|
||||
o = OptionDescription('od', '', [b])
|
||||
o._build_cache_option()
|
||||
o._build_cache()
|
||||
w = weakref.ref(b)
|
||||
del(b)
|
||||
assert w() is not None
|
||||
@ -101,7 +101,7 @@ def test_deref_optiondescription_cache():
|
||||
return
|
||||
b = BoolOption('b', '')
|
||||
o = OptionDescription('od', '', [b])
|
||||
o._build_cache_option()
|
||||
o._build_cache()
|
||||
w = weakref.ref(o)
|
||||
del(b)
|
||||
assert w() is not None
|
||||
|
@ -342,7 +342,8 @@ def test_meta_unconsistent():
|
||||
i4 = IntOption('i4', '', default=2)
|
||||
od1 = OptionDescription('od1', '', [i1, i2, i3, i4])
|
||||
od2 = OptionDescription('od2', '', [od1])
|
||||
od3 = OptionDescription('od3', '', [od1])
|
||||
i5 = IntOption('i5', '')
|
||||
od3 = OptionDescription('od3', '', [i5])
|
||||
conf1 = Config(od2, session_id='conf1')
|
||||
conf2 = Config(od2, session_id='conf2')
|
||||
conf3 = Config(od2, session_id='conf3')
|
||||
|
@ -291,7 +291,9 @@ def test_mix_unconsistent():
|
||||
conf1 = Config(od2, session_id='conf1')
|
||||
conf2 = Config(od2, session_id='conf2')
|
||||
conf3 = Config(od2, session_id='conf3')
|
||||
conf4 = Config(od3, session_id='conf4')
|
||||
i5 = IntOption('i5', '')
|
||||
od4 = OptionDescription('od4', '', [i5])
|
||||
conf4 = Config(od4, session_id='conf4')
|
||||
mix = MixConfig(od2, [conf1, conf2])
|
||||
mix.owner.set(owners.mix1)
|
||||
raises(TypeError, 'MixConfig(od2, "string")')
|
||||
|
@ -45,7 +45,6 @@ def test_option_get_information():
|
||||
raises(ValueError, "i.impl_get_information('noinfo')")
|
||||
assert i.impl_get_information('noinfo', 'default') == 'default'
|
||||
assert i.impl_get_information('doc') == description
|
||||
assert i.impl_getdoc() == description
|
||||
|
||||
|
||||
def test_option_get_information_config():
|
||||
@ -61,7 +60,6 @@ def test_option_get_information_config():
|
||||
raises(ValueError, "i.impl_get_information('noinfo')")
|
||||
assert i.impl_get_information('noinfo', 'default') == 'default'
|
||||
assert i.impl_get_information('doc') == description
|
||||
assert i.impl_getdoc() == description
|
||||
|
||||
|
||||
def test_option_get_information_config2():
|
||||
@ -77,7 +75,6 @@ def test_option_get_information_config2():
|
||||
raises(ValueError, "i.impl_get_information('noinfo')")
|
||||
assert i.impl_get_information('noinfo', 'default') == 'default'
|
||||
assert i.impl_get_information('doc') == description
|
||||
assert i.impl_getdoc() == description
|
||||
|
||||
|
||||
def test_optiondescription_get_information():
|
||||
@ -89,7 +86,6 @@ def test_optiondescription_get_information():
|
||||
raises(ValueError, "o.impl_get_information('noinfo')")
|
||||
assert o.impl_get_information('noinfo', 'default') == 'default'
|
||||
assert o.impl_get_information('doc') == description
|
||||
assert o.impl_getdoc() == description
|
||||
|
||||
|
||||
def test_option_isoptiondescription():
|
||||
|
Reference in New Issue
Block a user