[PATCH bmaptool v2 7/7] tests: Fix typos

Folker Schwesinger dev at folker-schwesinger.de
Wed Apr 24 09:49:03 PDT 2024


Fix various typos in comments, docstrings and user-facing error
messages in various test files.

Signed-off-by: Folker Schwesinger <dev at folker-schwesinger.de>
---
 tests/helpers.py           |  2 +-
 tests/test_api_base.py     |  4 ++--
 tests/test_bmap_helpers.py | 16 ++++++++--------
 tests/test_compat.py       |  2 +-
 tests/test_filemap.py      |  2 +-
 5 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/tests/helpers.py b/tests/helpers.py
index df57f15..9e8cb16 100644
--- a/tests/helpers.py
+++ b/tests/helpers.py
@@ -177,7 +177,7 @@ def generate_test_files(max_size=4 * 1024 * 1024, directory=None, delete=True):
         file_obj.close()
 
     #
-    # Generate a random sparse files
+    # Generate random sparse files
     #
 
     # The maximum size
diff --git a/tests/test_api_base.py b/tests/test_api_base.py
index 1cb6cbc..b54e92f 100644
--- a/tests/test_api_base.py
+++ b/tests/test_api_base.py
@@ -16,7 +16,7 @@
 
 """
 This test verifies the base bmap creation and copying API functionality. It
-generates a random sparse file, then creates a bmap fir this file and copies it
+generates a random sparse file, then creates a bmap for this file and copies it
 to a different file using the bmap. Then it compares the original random sparse
 file and the copy and verifies that they are identical.
 """
@@ -216,7 +216,7 @@ def _do_test(image, image_size, delete=True):
             compressed, f_copy.name, f_bmap1.name, image_chksum, None
         )
 
-        # Append a "file:" prefixe to make BmapCopy use urllib
+        # Append a "file:" prefix to make BmapCopy use urllib
         compressed = "file:" + compressed
         helpers.copy_and_verify_image(
             compressed, f_copy.name, f_bmap1.name, image_chksum, image_size
diff --git a/tests/test_bmap_helpers.py b/tests/test_bmap_helpers.py
index db5ec6e..f224731 100644
--- a/tests/test_bmap_helpers.py
+++ b/tests/test_bmap_helpers.py
@@ -53,7 +53,7 @@ class TestBmapHelpers(unittest.TestCase):
             self.assertTrue(fstype)
 
     def test_get_file_system_type_no_fstype_found(self):
-        """Check error raised when supplied file doesnt exist"""
+        """Check error raised when supplied file doesn't exist"""
 
         directory = os.path.dirname(__file__)
         fobj = os.path.join(directory, "BmapHelpers/file/does/not/exist")
@@ -73,7 +73,7 @@ class TestBmapHelpers(unittest.TestCase):
             self.assertTrue(fstype)
 
     def test_is_zfs_configuration_compatible_enabled(self):
-        """Check compatiblilty check is true when zfs param is set correctly"""
+        """Check compatibility check is true when zfs param is set correctly"""
 
         with tempfile.NamedTemporaryFile(
             "w+", prefix="testfile_", delete=True, dir=".", suffix=".txt"
@@ -85,7 +85,7 @@ class TestBmapHelpers(unittest.TestCase):
                 self.assertTrue(BmapHelpers.is_zfs_configuration_compatible())
 
     def test_is_zfs_configuration_compatible_disabled(self):
-        """Check compatiblilty check is false when zfs param is set incorrectly"""
+        """Check compatibility check is false when zfs param is set incorrectly"""
 
         with tempfile.NamedTemporaryFile(
             "w+", prefix="testfile_", delete=True, dir=".", suffix=".txt"
@@ -116,8 +116,8 @@ class TestBmapHelpers(unittest.TestCase):
             if not BmapHelpers.is_zfs_configuration_compatible():
                 raise BmapHelpers.Error
 
-    def test_is_zfs_configuration_compatible_notinstalled(self):
-        """Check compatiblilty check passes when zfs not installed"""
+    def test_is_zfs_configuration_compatible_not_installed(self):
+        """Check compatibility check passes when zfs not installed"""
 
         directory = os.path.dirname(__file__)
         filepath = os.path.join(directory, "BmapHelpers/file/does/not/exist")
@@ -129,7 +129,7 @@ class TestBmapHelpers(unittest.TestCase):
     def test_is_compatible_file_system_zfs_valid(
         self, mock_get_fs_type
     ):  # pylint: disable=unused-argument
-        """Check compatiblilty check passes when zfs param is set correctly"""
+        """Check compatibility check passes when zfs param is set correctly"""
 
         with tempfile.NamedTemporaryFile(
             "w+", prefix="testfile_", delete=True, dir=".", suffix=".img"
@@ -144,7 +144,7 @@ class TestBmapHelpers(unittest.TestCase):
     def test_is_compatible_file_system_zfs_invalid(
         self, mock_get_fs_type
     ):  # pylint: disable=unused-argument
-        """Check compatiblilty check fails when zfs param is set incorrectly"""
+        """Check compatibility check fails when zfs param is set incorrectly"""
 
         with tempfile.NamedTemporaryFile(
             "w+", prefix="testfile_", delete=True, dir=".", suffix=".img"
@@ -159,7 +159,7 @@ class TestBmapHelpers(unittest.TestCase):
     def test_is_compatible_file_system_ext4(
         self, mock_get_fs_type
     ):  # pylint: disable=unused-argument
-        """Check non-zfs file systems pass compatiblilty checks"""
+        """Check non-zfs file systems pass compatibility checks"""
 
         with tempfile.NamedTemporaryFile(
             "w+", prefix="testfile_", delete=True, dir=".", suffix=".img"
diff --git a/tests/test_compat.py b/tests/test_compat.py
index 2f93e7b..86acfff 100644
--- a/tests/test_compat.py
+++ b/tests/test_compat.py
@@ -121,7 +121,7 @@ class TestCompat(unittest.TestCase):
 
     def _do_test_older_bmapcopy(self, bmap_path, modref):
         """
-        Test an older version of BmapCopy class, referenced to by the 'modref'
+        Test an older version of BmapCopy class, referenced by the 'modref'
         argument. The 'bmap_path' argument is the bmap file path to test with.
         """
 
diff --git a/tests/test_filemap.py b/tests/test_filemap.py
index 3603498..2646867 100644
--- a/tests/test_filemap.py
+++ b/tests/test_filemap.py
@@ -85,7 +85,7 @@ def _check_ranges(f_image, filemap, first_block, blocks_cnt, ranges, ranges_type
 
         if check[0] > check[1] or check != correct:
             raise Error(
-                "bad or unmatching %s range for file '%s': correct "
+                "bad or mismatching %s range for file '%s': correct "
                 "is %d-%d, get_%s_ranges(%d, %d) returned %d-%d"
                 % (
                     ranges_type,
-- 
2.44.0



More information about the Bmap-tools mailing list