From: JINMEI Tatuya Date: Fri, 22 Feb 2013 18:38:37 +0000 (-0800) Subject: [2689] a bit of cleanup: rename some internal methods and add comments. X-Git-Tag: bind10-1.1.0beta1-release~76^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d6e34fc0d99e325ccd5f253abdbb1abd27b21935;p=thirdparty%2Fkea.git [2689] a bit of cleanup: rename some internal methods and add comments. "check" in __check_group_recvmsg was added for a historical reason and is not really appropriate any more (it doesn't do any check internally) --- diff --git a/src/bin/stats/tests/test_utils.py b/src/bin/stats/tests/test_utils.py index f9a9a5d84e..bfabc13cbf 100644 --- a/src/bin/stats/tests/test_utils.py +++ b/src/bin/stats/tests/test_utils.py @@ -522,8 +522,8 @@ class SimpleStats(stats.Stats): # _init_statistics_data. This will get the Stats module info from # the file directly and some amount information about the Init and # Auth modules (hardcoded below). - self.cc_session.group_sendmsg = self.__check_group_sendmsg - self.cc_session.group_recvmsg = self.__check_group_recvmsg + self.cc_session.group_sendmsg = self.__group_sendmsg + self.cc_session.group_recvmsg = self.__group_recvmsg self.cc_session.rpc_call = self.__rpc_call stats.Stats._init_statistics_data(self) @@ -556,7 +556,7 @@ class SimpleStats(stats.Stats): # initialization until we are ready. pass - def __check_group_sendmsg(self, command, destination, want_answer=False): + def __group_sendmsg(self, command, destination, want_answer=False): """Faked ModuleCCSession.group_sendmsg for tests. Skipping actual network communication, and just returning an internally @@ -566,7 +566,7 @@ class SimpleStats(stats.Stats): self.__seq += 1 return self.__seq - def __check_group_recvmsg(self, nonblocking, seq): + def __group_recvmsg(self, nonblocking, seq): """Faked ModuleCCSession.group_recvmsg for tests. Skipping actual network communication, and returning an internally @@ -580,7 +580,13 @@ class SimpleStats(stats.Stats): return self._answers.pop(0) def __rpc_call(self, command, group): - answer, _ = self.__check_group_recvmsg(None, None) + """Faked ModuleCCSession.rpc_call for tests. + + At the moment we don't have to cover failure cases, so this is a + simple wrapper for the faked group_recvmsg(). + + """ + answer, _ = self.__group_recvmsg(None, None) return isc.config.ccsession.parse_answer(answer)[1] class MyStats(stats.Stats):