diff --git a/test/new_api/test_cache.py b/test/new_api/test_cache.py index 0ff7683..8a9a58a 100644 --- a/test/new_api/test_cache.py +++ b/test/new_api/test_cache.py @@ -245,6 +245,7 @@ def test_reset_cache_only_expired(): od1 = make_description() c = Config(od1) api = getapi(c) + api.property.add('expire') values = c.cfgimpl_get_values() settings = c.cfgimpl_get_settings() api.option('u1').value.get() @@ -274,7 +275,7 @@ def test_cache_not_expire(): api = getapi(c) values = c.cfgimpl_get_values() settings = c.cfgimpl_get_settings() - api.property.pop('expire') + #api.property.pop('expire') api.option('u1').value.get() assert 'u1' in values._p_.get_cached() assert 'u1' in settings._p_.get_cached() @@ -438,7 +439,7 @@ def test_cache_callback(): cfg = Config(maconfig) api = getapi(cfg) api.property.read_write() - api.property.pop('expire') + #api.property.pop('expire') api.option.make_dict() #assert cfg.cfgimpl_get_settings()._p_.get_cached() == {None: {None: (set(['cache', 'disabled', 'frozen', 'hidden', 'validator', 'warnings']), None)}, # 'val1': {None: (set([]), None)}} @@ -528,7 +529,7 @@ def test_cache_master_and_slaves_master(): cfg = Config(maconfig) api = getapi(cfg) api.property.read_write() - api.property.pop('expire') + #api.property.pop('expire') api.option.make_dict() global_props = ['cache', 'disabled', 'frozen', 'hidden', 'validator', 'warnings'] val1_props = [] @@ -606,7 +607,7 @@ def test_cache_master_callback(): cfg = Config(maconfig) api = getapi(cfg) api.property.read_write() - api.property.pop('expire') + #api.property.pop('expire') api.option.make_dict() global_props = ['cache', 'disabled', 'frozen', 'hidden', 'validator', 'warnings'] val1_props = [] @@ -705,7 +706,7 @@ def test_cache_requires(): c = Config(od) api = getapi(c) api.property.read_write() - api.property.pop('expire') + #api.property.pop('expire') #assert c.cfgimpl_get_settings()._p_.get_cached() == {} assert c.cfgimpl_get_values()._p_.get_cached() == {} assert api.option('ip_address_service').value.get() == None @@ -754,7 +755,7 @@ def test_cache_global_properties(): c = Config(od) api = getapi(c) api.property.read_write() - api.property.pop('expire') + #api.property.pop('expire') #assert c.cfgimpl_get_settings()._p_.get_cached() == {} assert c.cfgimpl_get_values()._p_.get_cached() == {} assert api.option('ip_address_service').value.get() == None @@ -783,6 +784,7 @@ def test_callback_value_incr(): cfg = Config(maconfig) api = getapi(cfg) api.property.read_write() + api.property.add('expire') assert api.option('val1').value.get() == 1 sleep(1) assert api.option('val2').value.get() == 1 diff --git a/test/new_api/test_option_setting.py b/test/new_api/test_option_setting.py index 07be0be..5290dbf 100644 --- a/test/new_api/test_option_setting.py +++ b/test/new_api/test_option_setting.py @@ -446,7 +446,7 @@ def test_reset_properties_force_store_value(): assert api.property.get_modified() == {} api.property.add('frozen') assert api.property.get_modified() == \ - {None: set(('frozen', 'expire', 'cache', 'validator', 'warnings'))} + {None: set(('frozen', 'cache', 'validator', 'warnings'))} api.property.reset() assert api.property.get_modified() == {} api.option('gc.dummy').property.add('test') @@ -455,15 +455,15 @@ def test_reset_properties_force_store_value(): assert api.property.get_modified() == {'gc.dummy': set(('test', 'force_store_value'))} api.property.add('frozen') assert api.property.get_modified() == \ - {None: set(('frozen', 'expire', 'validator', 'cache', 'warnings')), + {None: set(('frozen', 'validator', 'cache', 'warnings')), 'gc.dummy': set(('test', 'force_store_value'))} api.property.add('frozen') assert api.property.get_modified() == \ - {None: set(('frozen', 'expire', 'validator', 'cache', 'warnings')), + {None: set(('frozen', 'validator', 'cache', 'warnings')), 'gc.dummy': set(('test', 'force_store_value'))} api.option('gc.dummy').property.add('test') assert api.property.get_modified() == \ - {None: set(('frozen', 'expire', 'validator', 'cache', 'warnings')), + {None: set(('frozen', 'validator', 'cache', 'warnings')), 'gc.dummy': set(('test', 'force_store_value'))} @@ -473,9 +473,9 @@ def test_set_modified_value(): descr = OptionDescription('tiramisu', '', [gcgroup]) api = getapi(Config(descr)) assert api.property.get_modified() == {} - api.property.set_modified({None: set(('frozen', 'expire', 'cache', 'validator', 'warnings'))}) + api.property.set_modified({None: set(('frozen', 'cache', 'validator', 'warnings'))}) assert api.property.get_modified() == \ - {None: set(('frozen', 'expire', 'cache', 'validator', 'warnings'))} + {None: set(('frozen', 'cache', 'validator', 'warnings'))} def test_pprint(): diff --git a/tiramisu/setting.py b/tiramisu/setting.py index 4795fe9..bd180db 100644 --- a/tiramisu/setting.py +++ b/tiramisu/setting.py @@ -85,7 +85,7 @@ validator warnings display warnings during validation """ -default_properties = ('cache', 'expire', 'validator', 'warnings') +default_properties = ('cache', 'validator', 'warnings') """Config can be in two defaut mode: diff --git a/tiramisu/value.py b/tiramisu/value.py index 5f3cb5b..628610b 100644 --- a/tiramisu/value.py +++ b/tiramisu/value.py @@ -118,9 +118,7 @@ class Values(object): config_bag=config_bag) # store value in cache if not is_cached and \ - setting_properties and 'cache' in setting_properties and \ - config_bag.validate and config_bag.force_permissive is False and \ - config_bag.trusted_cached_properties is True: + setting_properties and 'cache' in setting_properties: if 'expire' in setting_properties: if ntime is None: ntime = int(time())