BIND 10 trac640, updated. 2c40ed8bbbab2e095be163a6f144eb45be465f80 [640] minor refactor in a few tests

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Feb 2 13:26:25 UTC 2012


The branch, trac640 has been updated
       via  2c40ed8bbbab2e095be163a6f144eb45be465f80 (commit)
      from  df25eedae7f4e65ed0a8ecd2f95722061335d498 (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 2c40ed8bbbab2e095be163a6f144eb45be465f80
Author: Jelte Jansen <jelte at isc.org>
Date:   Thu Feb 2 14:26:09 2012 +0100

    [640] minor refactor in a few tests

-----------------------------------------------------------------------

Summary of changes:
 src/bin/stats/tests/b10-stats-httpd_test.py        |    5 +++--
 src/bin/stats/tests/test_utils.py                  |   11 -----------
 .../testutils/{__init__.py => ccsession_mock.py}   |   13 +++++++++++--
 3 files changed, 14 insertions(+), 15 deletions(-)
 copy src/lib/python/isc/testutils/{__init__.py => ccsession_mock.py} (77%)

-----------------------------------------------------------------------
diff --git a/src/bin/stats/tests/b10-stats-httpd_test.py b/src/bin/stats/tests/b10-stats-httpd_test.py
index f1c28f7..e74405a 100644
--- a/src/bin/stats/tests/b10-stats-httpd_test.py
+++ b/src/bin/stats/tests/b10-stats-httpd_test.py
@@ -38,8 +38,9 @@ import isc
 import stats_httpd
 import stats
 from test_utils import BaseModules, ThreadingServerManager, MyStats,\
-                       MyStatsHttpd, SignalHandler, MyModuleCCSession,\
+                       MyStatsHttpd, SignalHandler,\
                        send_command, send_shutdown
+from isc.testutils.ccsession_mock import MockModuleCCSession
 
 DUMMY_DATA = {
     'Boss' : {
@@ -678,7 +679,7 @@ class TestStatsHttpd(unittest.TestCase):
 
     def test_openclose_mccs(self):
         self.stats_httpd = MyStatsHttpd(get_availaddr())
-        mccs = MyModuleCCSession()
+        mccs = MockModuleCCSession()
         self.stats_httpd.mccs = mccs
         self.assertFalse(self.stats_httpd.mccs.stopped)
         self.assertFalse(self.stats_httpd.mccs.closed)
diff --git a/src/bin/stats/tests/test_utils.py b/src/bin/stats/tests/test_utils.py
index 4f4659a..3f6ff33 100644
--- a/src/bin/stats/tests/test_utils.py
+++ b/src/bin/stats/tests/test_utils.py
@@ -349,17 +349,6 @@ class MyStats(stats.Stats):
     def shutdown(self):
         self.command_shutdown()
 
-class MyModuleCCSession():
-    def __init__(self):
-        self.stopped = False
-        self.closed = False
-
-    def stop(self):
-        self.stopped = True
-
-    def close(self):
-        self.closed = True
-
 class MyStatsHttpd(stats_httpd.StatsHttpd):
     ORIG_SPECFILE_LOCATION = stats_httpd.SPECFILE_LOCATION
     def __init__(self, *server_address):
diff --git a/src/lib/python/isc/testutils/ccsession_mock.py b/src/lib/python/isc/testutils/ccsession_mock.py
new file mode 100644
index 0000000..c974be9
--- /dev/null
+++ b/src/lib/python/isc/testutils/ccsession_mock.py
@@ -0,0 +1,26 @@
+# Copyright (C) 2011  Internet Systems Consortium.
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
+# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+# INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
+# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+class MockModuleCCSession():
+    def __init__(self):
+        self.started = False
+        self.stopped = False
+        self.closed = False
+
+    def stop(self):
+        self.stopped = True
+
+    def close(self):
+        self.closed = True




More information about the bind10-changes mailing list