add some tests for values
[tiramisu.git] / tiramisu / value.py
index 9535869..fb62698 100644 (file)
@@ -218,8 +218,7 @@ class Values(object):
         return value
 
     def __setitem__(self, opt, value):
-        path = self._get_opt_path(opt)
-        self.setitem(opt, value, path)
+        raise ValueError('you should only set value with config')
 
     def setitem(self, opt, value, path, force_permissive=False,
                 is_write=True):
@@ -409,16 +408,9 @@ class Multi(list):
                         dvalue = values._getcallback_value(slave, index=index)
                     else:
                         dvalue = slave.impl_getdefault_multi()
-                    old_value = values.getitem(slave, path,
-                                               validate_properties=False)
-                    if len(old_value) < self.__len__():
-                        values.getitem(slave, path,
-                                       validate_properties=False).append(
-                                           dvalue, force=True)
-                    else:
-                        values.getitem(slave, path,
-                                       validate_properties=False)[
-                                           index] = dvalue
+                    values.getitem(slave, path,
+                                   validate_properties=False).append(
+                                       dvalue, force=True)
 
     def sort(self, cmp=None, key=None, reverse=False):
         if self.opt.impl_get_multitype() in [multitypes.slave,