BIND 10 trac1443, updated. 0161c02ad4d593dc6a7ad5b352cf7db4e70b3b48 [1443] cleanup and docstring for new test

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Mar 26 10:21:58 UTC 2012


The branch, trac1443 has been updated
       via  0161c02ad4d593dc6a7ad5b352cf7db4e70b3b48 (commit)
      from  d98c6ee0863c784e79204242a3d868d4aedc3d5a (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 0161c02ad4d593dc6a7ad5b352cf7db4e70b3b48
Author: Jelte Jansen <jelte at isc.org>
Date:   Mon Mar 26 12:03:58 2012 +0200

    [1443] cleanup and docstring for new test

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

Summary of changes:
 src/lib/python/isc/config/tests/cfgmgr_test.py |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/python/isc/config/tests/cfgmgr_test.py b/src/lib/python/isc/config/tests/cfgmgr_test.py
index bda2ffd..891a7d7 100644
--- a/src/lib/python/isc/config/tests/cfgmgr_test.py
+++ b/src/lib/python/isc/config/tests/cfgmgr_test.py
@@ -74,7 +74,14 @@ class TestConfigManagerData(unittest.TestCase):
         self.assertEqual(self.config_manager_data, new_config)
         os.remove(output_file_name)
 
-    def check_existance(self, files, should_exist=[], should_not_exist=[]):
+    def check_existence(self, files, should_exist=[], should_not_exist=[]):
+        """Helper function for test_rename_config_file.
+           Arguments:
+           files: array of file names to check.
+           should_exist: array of indices, the files in 'files' with these
+                         indices should exist.
+           should_not_exist: array of indices, the files in 'files' with
+                             these indices should not exist."""
         for n in should_exist:
             self.assertTrue(os.path.exists(files[n]))
         for n in should_not_exist:
@@ -93,28 +100,28 @@ class TestConfigManagerData(unittest.TestCase):
 
         # The original does not exist, so the new one should not be created
         self.config_manager_data.rename_config_file(filenames[0])
-        self.check_existance(filenames, [], [0, 1, 2, 3])
+        self.check_existence(filenames, [], [0, 1, 2, 3])
 
         # now create a file to rename, and call rename again
         self.config_manager_data.write_to_file(filenames[0])
         self.config_manager_data.rename_config_file(filenames[0])
-        self.check_existance(filenames, [1], [0, 2, 3])
+        self.check_existence(filenames, [1], [0, 2, 3])
 
         # If backup already exists, give it a new name automatically
         self.config_manager_data.write_to_file(filenames[0])
         self.config_manager_data.rename_config_file(filenames[0])
-        self.check_existance(filenames, [1, 2], [0, 3])
+        self.check_existence(filenames, [1, 2], [0, 3])
 
         # If backup already exists, give it a new name automatically with
         # increasing postfix
         self.config_manager_data.write_to_file(filenames[0])
         self.config_manager_data.rename_config_file(filenames[0])
-        self.check_existance(filenames, [1, 2, 3], [0])
+        self.check_existence(filenames, [1, 2, 3], [0])
 
         # Test with explicit renamed file argument
         self.config_manager_data.rename_config_file(filenames[1],
                                                     filenames[0])
-        self.check_existance(filenames, [0, 2, 3], [1])
+        self.check_existence(filenames, [0, 2, 3], [1])
 
         # clean up again to be nice
         for filename in filenames:



More information about the bind10-changes mailing list