frozen with force_default_on_freeze can change owner
authorEmmanuel Garette <egarette@cadoles.com>
Sun, 26 Oct 2014 08:44:06 +0000 (09:44 +0100)
committerEmmanuel Garette <egarette@cadoles.com>
Sun, 26 Oct 2014 08:44:06 +0000 (09:44 +0100)
ChangeLog
test/test_option_default.py
tiramisu/value.py
translations/tiramisu.pot

index bb4c863..04dcd46 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@ Sun Oct 26 08:50:38 2014 +0200 Emmanuel Garette <egarette@cadoles.com>
        * if option is frozen with force_default_on_freeze property, owner
        must be 'default' check property when tried to change owner
        * bad characters in DomainnameOption could be in warning level
+       * frozen with force_default_on_freeze can change owner
 
 Sat Oct 25 22:48:08 2014 +0200 Emmanuel Garette <egarette@cadoles.com>
        * cannot add unvalaible consistency for an option
index f7b483f..6aaf631 100644 (file)
@@ -75,7 +75,7 @@ def test_force_default_on_freeze():
     assert config.dummy2 is False
     assert config.getowner(dummy1) == owners.default
     assert config.getowner(dummy2) == owners.user
-    raises(ConfigError, "config.cfgimpl_get_values().setowner(dummy1, owners.frozen)")
+    raises(PropertiesOptionError, "config.cfgimpl_get_values().setowner(dummy1, owners.frozen)")
     raises(PropertiesOptionError, "config.cfgimpl_get_values().setowner(dummy2, owners.frozen)")
     raises(PropertiesOptionError, "del(config.dummy1)")
     setting[dummy1].remove('frozen')
@@ -102,7 +102,7 @@ def test_force_default_on_freeze_multi():
     assert config.dummy2 == [True, False]
     assert config.getowner(dummy1) == owners.default
     assert config.getowner(dummy2) == owners.user
-    raises(ConfigError, "config.cfgimpl_get_values().setowner(dummy1, owners.frozenmulti)")
+    raises(PropertiesOptionError, "config.cfgimpl_get_values().setowner(dummy1, owners.frozenmulti)")
     raises(PropertiesOptionError, "config.cfgimpl_get_values().setowner(dummy2, owners.frozenmulti)")
     raises(PropertiesOptionError, "del(config.dummy1)")
     setting[dummy1].remove('frozen')
index d0a8eaa..4575cbf 100644 (file)
@@ -382,7 +382,7 @@ class Values(object):
         self._setowner(opt, path, owner)
 
     def _setowner(self, opt, path, owner):
-        if self._getowner(opt, path) == owners.default:  # pragma: optional cover
+        if not self._p_.hasvalue(path):  # pragma: optional cover
             raise ConfigError(_('no value for {0} cannot change owner to {1}'
                                 '').format(path, owner))
         self._getcontext().cfgimpl_get_settings().validate_properties(opt,
index eee861d..57e07f7 100644 (file)
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2014-10-26 09:35+CET\n"
+"POT-Creation-Date: 2014-10-26 09:42+CET\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"