tiramisu/setting.py : properties store in cache was a reference to a list modified...
[tiramisu.git] / test / test_option_setting.py
index ed5f7d7..94755e8 100644 (file)
@@ -367,3 +367,14 @@ def test_reset_multiple():
     setting[option].append('test')
     setting.reset(all_properties=True)
     setting.reset(all_properties=True)
+
+
+def test_properties_cached():
+    b1 = BoolOption("b1", "", properties=('test',))
+    descr = OptionDescription("opt", "", [OptionDescription("sub", "", [b1])])
+    c = Config(descr)
+    c.read_write()
+    setting = c.cfgimpl_get_settings()
+    option = c.cfgimpl_get_description().sub.b1
+    c._setattr('sub.b1', True, force_permissive=True)
+    assert str(setting[b1]) == "['test']"