rename API add_owner -> addowner
authorgwen <gremond@cadoles.com>
Tue, 27 Aug 2013 14:12:53 +0000 (16:12 +0200)
committergwen <gremond@cadoles.com>
Tue, 27 Aug 2013 14:12:53 +0000 (16:12 +0200)
test/test_metaconfig.py
test/test_option_owner.py
tiramisu/setting.py
tiramisu/storage/sqlite3/value.py

index 4918649..35d65d5 100644 (file)
@@ -7,7 +7,7 @@
 #from tiramisu.option import IntOption, OptionDescription
 #from tiramisu.error import ConfigError
 
-#owners.add_owner('meta')
+#owners.addowner('meta')
 
 
 #def make_description():
index eb3790a..bc96285 100644 (file)
@@ -40,13 +40,13 @@ def test_default_owner():
     assert cfg.getowner(gcdummy) == owners.user
 
 
-def test_add_owner():
+def test_addowner():
     gcdummy = BoolOption('dummy', 'dummy', default=False)
     descr = OptionDescription('tiramisu', '', [gcdummy])
     cfg = Config(descr)
     assert cfg.dummy is False
     assert cfg.getowner(gcdummy) == 'default'
-    owners.add_owner("gen_config")
+    owners.addowner("gen_config")
     cfg.cfgimpl_get_settings().setowner(owners.gen_config)
     cfg.dummy = True
     assert cfg.getowner(gcdummy) == owners.gen_config
@@ -79,7 +79,7 @@ def test_setowner_for_value():
     cfg = Config(descr)
     assert cfg.dummy is False
     assert cfg.getowner(gcdummy) == 'default'
-    owners.add_owner("new")
+    owners.addowner("new")
     raises(ConfigError, "cfg.cfgimpl_get_values().setowner(gcdummy, owners.new)")
     cfg.dummy = False
     assert cfg.getowner(gcdummy) == owners.user
index e2620cd..e6bc645 100644 (file)
@@ -132,12 +132,12 @@ def populate_owners():
     setattr(owners, 'default', owners.DefaultOwner('default'))
     setattr(owners, 'user', owners.Owner('user'))
 
-    def add_owner(name):
+    def addowner(name):
         """
         :param name: the name of the new owner
         """
         setattr(owners, name, owners.Owner(name))
-    setattr(owners, 'add_owner', add_owner)
+    setattr(owners, 'addowner', addowner)
 
 # names are in the module now
 populate_owners()
index 647c41e..a70b675 100644 (file)
@@ -37,7 +37,7 @@ class Values(Cache):
             try:
                 getattr(owners, owner[0])
             except AttributeError:
-                owners.add_owner(owner[0])
+                owners.addowner(owner[0])
 
     # sqlite
     def _sqlite_select(self, path):
@@ -112,5 +112,5 @@ class Values(Cache):
             try:
                 return getattr(owners, owner)
             except AttributeError:
-                owners.add_owner(owner)
+                owners.addowner(owner)
                 return getattr(owners, owner)