3 #from py.test import raises
5 from tiramisu.config import Config
6 from tiramisu.option import BoolOption, OptionDescription
10 def test_deref_storage():
11 b = BoolOption('b', '')
12 o = OptionDescription('od', '', [b])
14 w = weakref.ref(c.cfgimpl_get_values()._p_)
19 def test_deref_value():
20 b = BoolOption('b', '')
21 o = OptionDescription('od', '', [b])
23 w = weakref.ref(c.cfgimpl_get_values())
28 def test_deref_setting():
29 b = BoolOption('b', '')
30 o = OptionDescription('od', '', [b])
32 w = weakref.ref(c.cfgimpl_get_settings())
37 def test_deref_config():
38 b = BoolOption('b', '')
39 o = OptionDescription('od', '', [b])
46 def test_deref_option():
47 b = BoolOption('b', '')
48 o = OptionDescription('od', '', [b])
51 assert w() is not None
56 def test_deref_optiondescription():
57 b = BoolOption('b', '')
58 o = OptionDescription('od', '', [b])
61 assert w() is not None
66 def test_deref_option_cache():
67 b = BoolOption('b', '')
68 o = OptionDescription('od', '', [b])
72 assert w() is not None
77 def test_deref_optiondescription_cache():
78 b = BoolOption('b', '')
79 o = OptionDescription('od', '', [b])
83 assert w() is not None
88 def test_deref_option_config():
89 b = BoolOption('b', '')
90 o = OptionDescription('od', '', [b])
94 assert w() is not None
96 assert w() is not None
101 def test_deref_optiondescription_config():
102 b = BoolOption('b', '')
103 o = OptionDescription('od', '', [b])
107 assert w() is not None
109 assert w() is not None