BIND 10 trac615, updated. 7a3dc628e96dd7b5201a8a1d3851992ea8d325ce [trac615] Eliminate hardcoded values
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Mar 14 18:56:19 UTC 2011
The branch, trac615 has been updated
via 7a3dc628e96dd7b5201a8a1d3851992ea8d325ce (commit)
from 1e67f2cbd82e555241a366d5b93a7a6ec52c7921 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7a3dc628e96dd7b5201a8a1d3851992ea8d325ce
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Mon Mar 14 19:52:26 2011 +0100
[trac615] Eliminate hardcoded values
They need to be put to the test file, if they are not default values of
parameters.
-----------------------------------------------------------------------
Summary of changes:
src/lib/python/isc/config/cfgmgr.py | 5 ++---
src/lib/python/isc/config/tests/cfgmgr_test.py | 8 +++++---
2 files changed, 7 insertions(+), 6 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/python/isc/config/cfgmgr.py b/src/lib/python/isc/config/cfgmgr.py
index ba62ee9..8561378 100644
--- a/src/lib/python/isc/config/cfgmgr.py
+++ b/src/lib/python/isc/config/cfgmgr.py
@@ -44,7 +44,7 @@ class ConfigManagerData:
"""This class hold the actual configuration information, and
reads it from and writes it to persistent storage"""
- def __init__(self, data_path, file_name="b10-config.db"):
+ def __init__(self, data_path, file_name):
"""Initialize the data for the configuration manager, and
set the version and path for the data store. Initializing
this does not yet read the database, a call to
@@ -159,8 +159,7 @@ class ConfigManager:
channel session. If not, a new session will be created.
The ability to specify a custom session is for testing purposes
and should not be needed for normal usage."""
- def __init__(self, data_path, database_filename="b10-config.db",
- session=None):
+ def __init__(self, data_path, database_filename, session=None):
"""Initialize the configuration manager. The data_path string
is the path to the directory where the configuration is
stored (in <data_path>/<database_filename> or in
diff --git a/src/lib/python/isc/config/tests/cfgmgr_test.py b/src/lib/python/isc/config/tests/cfgmgr_test.py
index 40d9af0..9534e14 100644
--- a/src/lib/python/isc/config/tests/cfgmgr_test.py
+++ b/src/lib/python/isc/config/tests/cfgmgr_test.py
@@ -27,7 +27,8 @@ class TestConfigManagerData(unittest.TestCase):
def setUp(self):
self.data_path = os.environ['CONFIG_TESTDATA_PATH']
self.writable_data_path = os.environ['CONFIG_WR_TESTDATA_PATH']
- self.config_manager_data = ConfigManagerData(self.writable_data_path)
+ self.config_manager_data = ConfigManagerData(self.writable_data_path,
+ file_name="b10-config.db")
self.assert_(self.config_manager_data)
def test_abs_file(self):
@@ -78,8 +79,8 @@ class TestConfigManagerData(unittest.TestCase):
# by equality of the .data element. If data_path or db_filename
# are different, but the contents are the same, it's still
# considered equal
- cfd1 = ConfigManagerData(self.data_path)
- cfd2 = ConfigManagerData(self.data_path)
+ cfd1 = ConfigManagerData(self.data_path, file_name="b10-config.db")
+ cfd2 = ConfigManagerData(self.data_path, file_name="b10-config.db")
self.assertEqual(cfd1, cfd2)
cfd2.data_path = "some/unknown/path"
self.assertEqual(cfd1, cfd2)
@@ -96,6 +97,7 @@ class TestConfigManager(unittest.TestCase):
self.writable_data_path = os.environ['CONFIG_WR_TESTDATA_PATH']
self.fake_session = FakeModuleCCSession()
self.cm = ConfigManager(self.writable_data_path,
+ database_filename="b10-config.db",
session=self.fake_session)
self.name = "TestModule"
self.spec = isc.config.module_spec_from_file(self.data_path + os.sep + "/spec2.spec")
More information about the bind10-changes
mailing list