Commit 8b143c88 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[2964] small refactoring: move more stuff from mock _cc_setup to ctor.

so we can test much larger part of _cc_setup().  right now no behavior change.
parent 36cb12b0
......@@ -250,10 +250,7 @@ class MockXfrin(Xfrin):
check_command_hook = None
def _cc_setup(self):
self._tsig_key = None
self._module_cc = MockCC()
init_keyring(self._module_cc)
pass
def _get_db_file(self):
pass
......
......@@ -1454,11 +1454,16 @@ class Xfrin:
# is used to trigger Auth/in-memory so that it reloads
# zones when they have been transfered in
self._memory_zones = set()
self._cc_setup()
self.recorder = XfrinRecorder()
self._shutdown_event = threading.Event()
self._counters = Counters(SPECFILE_LOCATION)
# Initial configuration
self._cc_setup()
config_data = self._module_cc.get_full_config()
self.config_handler(config_data)
init_keyring(self._module_cc)
def _cc_setup(self):
'''This method is used only as part of initialization, but is
implemented separately for convenience of unit tests; by letting
......@@ -1471,11 +1476,10 @@ class Xfrin:
self.config_handler,
self.command_handler)
self._module_cc.start()
config_data = self._module_cc.get_full_config()
self.config_handler(config_data)
# TBD: this will be removed in this branch
self._module_cc.add_remote_config(AUTH_SPECFILE_LOCATION,
self._auth_config_handler)
init_keyring(self._module_cc)
# END_OF_TBD
def _cc_check_command(self):
'''This is a straightforward wrapper for cc.check_command,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment