This commit is contained in:
Emmanuel Garette 2018-09-13 22:01:27 +02:00
parent f6a9b88795
commit e021e26d5a
7 changed files with 19 additions and 19 deletions

View File

@ -10,7 +10,6 @@ from tiramisu import BoolOption, StrOption, ChoiceOption, IPOption, \
OptionDescription, DynOptionDescription, DynSymLinkOption, submulti, MasterSlaves, \
Config, Params, ParamOption, ParamValue
from tiramisu.error import PropertiesOptionError, ConfigError, ConflictError
from tiramisu.storage import delete_session
from py.test import raises

View File

@ -27,6 +27,21 @@ def test_list():
assert 'test_non_persistent' not in list_sessions('config')
def test_delete_not_persisten():
b = BoolOption('b', '')
o = OptionDescription('od', '', [b])
try:
Config(o, session_id='test_persistent', persistent=True)
except:
c = Config(o, session_id='not_test_persistent')
assert list_sessions('all') == ['not_test_persistent']
del c
assert list_sessions('all') == []
#
c = Config(o, session_id='not_test_persistent')
raises(ValueError, "delete_session('not_test_persistent')")
def test_create_persistent():
b = BoolOption('b', '')
o = OptionDescription('od', '', [b])

View File

@ -103,9 +103,6 @@ class SynDynOptionDescription(object):
def impl_get_display_name(self):
return self._opt.impl_get_display_name() + self._suffix
def impl_getdoc(self):
return self._opt.impl_getdoc() + self._suffix
def reset_cache(self,
path,
values,

View File

@ -24,7 +24,6 @@ use it. But if something goes wrong, you will lost your modifications.
"""
from .value import Values
from .setting import Properties, Permissives
from .storage import setting, Storage, list_sessions, delete_session
from .storage import setting, Storage, list_sessions
__all__ = ('setting', 'Values', 'Properties', 'Permissives', 'Storage', 'list_sessions',
'delete_session')
__all__ = ('setting', 'Values', 'Properties', 'Permissives', 'Storage', 'list_sessions')

View File

@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# ____________________________________________________________
from ...i18n import _
from ...error import ConfigError, ConflictError
from ...error import ConflictError
class Setting(object):
@ -32,10 +32,6 @@ def list_sessions(): # pragma: optional cover
return _list_sessions
def delete_session(session_id): # pragma: optional cover
raise ConfigError(_('dictionary storage cannot delete session'))
class Storage(object):
__slots__ = ('session_id', 'persistent')
storage = 'dictionary'

View File

@ -41,9 +41,6 @@ class Values(Cache):
def commit(self):
pass
def getsession(self):
pass
def _setvalue_info(self, nb, idx, value, values, index, vidx):
lst = list(self._values[nb])
if idx is None:
@ -299,4 +296,4 @@ class Values(Cache):
self._values = export
def delete_session(session_id):
raise ValueError(_('a dictionary cannot be persistent'))
raise ValueError(_('cannot delete none persistent session'))

View File

@ -34,9 +34,6 @@ class Values(Sqlite3DB):
"""
super(Values, self).__init__(storage)
def getsession(self):
pass
# sqlite
def _sqlite_select(self, path, index):
request = "SELECT value FROM value WHERE path = ? AND session_id = ? "