Skip to content

Commit

Permalink
tests: Fix typos
Browse files Browse the repository at this point in the history
Fix various typos in comments, docstrings and user-facing error
messages in various test files.

Signed-off-by: Folker Schwesinger <[email protected]>
Signed-off-by: Joshua Watt <[email protected]>
  • Loading branch information
schwesinger authored and JPEWdev committed May 1, 2024
1 parent 9f1901d commit 2f88f2b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/test_api_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions tests/test_bmap_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_get_file_system_type(self):
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")
Expand All @@ -73,7 +73,7 @@ def test_get_file_system_type_symlink(self):
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"
Expand All @@ -85,7 +85,7 @@ def test_is_zfs_configuration_compatible_enabled(self):
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"
Expand Down Expand Up @@ -116,8 +116,8 @@ def test_is_zfs_configuration_compatible_unreadable_file(self, mock_open):
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")
Expand All @@ -129,7 +129,7 @@ def test_is_zfs_configuration_compatible_notinstalled(self):
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"
Expand All @@ -144,7 +144,7 @@ def test_is_compatible_file_system_zfs_valid(
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"
Expand All @@ -159,7 +159,7 @@ def test_is_compatible_file_system_zfs_invalid(
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"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def import_module(searched_module):

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.
"""

Expand Down
2 changes: 1 addition & 1 deletion tests/test_filemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2f88f2b

Please sign in to comment.