remove cache when import data
This commit is contained in:
@ -60,6 +60,42 @@ def test_cache():
|
||||
assert 'u2' in settings._p_.get_cached()
|
||||
|
||||
|
||||
def test_cache_importation():
|
||||
od1 = make_description()
|
||||
api = getapi(Config(od1))
|
||||
api.option('u2').value.set(1)
|
||||
export = api.value.exportation()
|
||||
assert api.option.make_dict() == {'u1': [], 'u2': 1, 'u3': []}
|
||||
api.option('u2').value.set(2)
|
||||
assert api.option.make_dict() == {'u1': [], 'u2': 2, 'u3': []}
|
||||
api.value.importation(export)
|
||||
assert api.option.make_dict() == {'u1': [], 'u2': 1, 'u3': []}
|
||||
|
||||
|
||||
def test_cache_importation_property():
|
||||
od1 = make_description()
|
||||
api = getapi(Config(od1))
|
||||
api.option('u2').property.add('prop')
|
||||
export = api.property.exportation()
|
||||
assert api.option('u2').property.get() == {'prop'}
|
||||
api.option('u2').property.add('prop2')
|
||||
assert api.option('u2').property.get() == {'prop', 'prop2'}
|
||||
api.property.importation(export)
|
||||
assert api.option('u2').property.get() == {'prop'}
|
||||
|
||||
|
||||
def test_cache_importation_permissive():
|
||||
od1 = make_description()
|
||||
api = getapi(Config(od1))
|
||||
api.option('u2').permissive.set(frozenset(['prop']))
|
||||
export = api.permissive.exportation()
|
||||
assert api.option('u2').permissive.get() == {'prop'}
|
||||
api.option('u2').permissive.set(frozenset(['prop', 'prop2']))
|
||||
assert api.option('u2').permissive.get() == {'prop', 'prop2'}
|
||||
api.permissive.importation(export)
|
||||
assert api.option('u2').permissive.get() == {'prop'}
|
||||
|
||||
|
||||
#def test_get_cache():
|
||||
# # force a value in cache, try if reget corrupted value
|
||||
# od1 = make_description()
|
||||
|
Reference in New Issue
Block a user