test_api_base: make compare_holes local
authorArtem Bityutskiy <artem.bityutskiy@intel.com>
Tue, 27 Nov 2012 07:11:15 +0000 (09:11 +0200)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Tue, 27 Nov 2012 07:11:15 +0000 (09:11 +0200)
The 'compare_holes()' function is only used in this test, so it is cleaner to
add a leading '_' to the name to show that it is a local function.

Change-Id: I8f2a446fefbc314640830e734db088e8ce39e05a
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
tests/test_api_base.py

index 27175ab..771e673 100644 (file)
@@ -21,7 +21,7 @@ class Error(Exception):
     """ A class for exceptions generated by this test. """
     pass
 
-def compare_holes(file1, file2):
+def _compare_holes(file1, file2):
     """ Make sure that files 'file1' and 'file2' have holes at the same places.
     The 'file1' and 'file2' arguments may be full file paths or file
     objects. """
@@ -87,7 +87,7 @@ def _do_test(f_image):
 
     # Make sure that holes in the copy are identical to holes in the random
     # sparse file.
-    compare_holes(f_image.name, f_copy.name)
+    _compare_holes(f_image.name, f_copy.name)
 
     #
     # Pass 2: same as pass 1, but use file objects instead of paths
@@ -100,7 +100,7 @@ def _do_test(f_image):
     writer.copy(False, True)
 
     assert _calculate_sha1(f_copy) == image_sha1
-    compare_holes(f_image, f_copy)
+    _compare_holes(f_image, f_copy)
 
     # Make sure the bmap files generated at pass 1 and pass 2 are identical
     assert filecmp.cmp(f_bmap1.name, f_bmap2.name, False)
@@ -118,7 +118,7 @@ def _do_test(f_image):
     writer.copy(False, True)
     writer.sync()
     assert _calculate_sha1(f_copy) == image_sha1
-    compare_holes(f_image, f_copy)
+    _compare_holes(f_image, f_copy)
     assert filecmp.cmp(f_bmap1.name, f_bmap2.name, False)
 
     #