From a1e4360f02c6edf94fba9fadc896ca8a0afd33f6 Mon Sep 17 00:00:00 2001 From: Folker Schwesinger Date: Wed, 24 Apr 2024 18:33:55 +0200 Subject: [PATCH 1/8] BmapCopy: Fix typos Fix various typos in comments and docstrings. Signed-off-by: Folker Schwesinger Signed-off-by: Joshua Watt --- src/bmaptool/BmapCopy.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/bmaptool/BmapCopy.py b/src/bmaptool/BmapCopy.py index 15113a8..a28c3d9 100644 --- a/src/bmaptool/BmapCopy.py +++ b/src/bmaptool/BmapCopy.py @@ -40,11 +40,11 @@ it is beneficial to distributor them as compressed files along with the bmap. Here is an example. Suppose you have a 4GiB image which contains only 100MiB of -user data and you need to flash it to a slow USB stick. With bmap you end up +user data, and you need to flash it to a slow USB stick. With bmap you end up copying only a little bit more than 100MiB of data from the image to the USB stick (namely, you copy only mapped blocks). This is a lot faster than copying all 4GiB of data. We say that it is a bit more than 100MiB because things like -file-system meta-data (inode tables, superblocks, etc), partition table, etc +file-system meta-data (inode tables, superblocks, etc.), partition table, etc. also contribute to the mapped blocks and are also copied. """ @@ -181,13 +181,13 @@ class BmapCopy(object): to the destination file. When the bmap is provided, it is not necessary to specify image size, - because the size is contained in the bmap. Otherwise, it is benefitial to + because the size is contained in the bmap. Otherwise, it is beneficial to specify the size because it enables extra sanity checks and makes it possible to provide the progress bar. When the image size is known either from the bmap or the caller specified it to the class constructor, all the image geometry description attributes - ('blocks_cnt', etc) are initialized by the class constructor and available + ('blocks_cnt', etc.) are initialized by the class constructor and available for the user. However, when the size is not known, some of the image geometry @@ -308,8 +308,8 @@ def set_psplash_pipe(self, path): functionality which might or might not be available even if requested. When used as a boot service, the unavailability of the psplash service (due to various reasons: no screen, racing issues etc.) should not - break the writting process. This is why this implementation is done as - a best effort. + break the writing process. This is why this implementation is done as + a best-effort. """ if os.path.exists(path) and stat.S_ISFIFO(os.stat(path).st_mode): @@ -321,7 +321,7 @@ def set_psplash_pipe(self, path): def set_progress_indicator(self, file_obj, format_string): """ - Setup the progress indicator which shows how much data has been copied + Set up the progress indicator which shows how much data has been copied in percent. The 'file_obj' argument is the console file object where the progress @@ -368,7 +368,7 @@ def _verify_bmap_checksum(self): correct_chksum = self._xml.find(self._bmap_cs_attrib_name).text.strip() - # Before verifying the shecksum, we have to substitute the checksum + # Before verifying the checksum, we have to substitute the checksum # value stored in the file with all zeroes. For these purposes we # create private memory mapping of the bmap file. mapped_bmap = mmap.mmap(self._f_bmap.fileno(), 0, access=mmap.ACCESS_COPY) @@ -399,7 +399,7 @@ def _parse_bmap(self): try: self._xml = ElementTree.parse(self._f_bmap) except ElementTree.ParseError as err: - # Extrace the erroneous line with some context + # Extract the erroneous line with some context self._f_bmap.seek(0) xml_extract = "" for num, line in enumerate(self._f_bmap): @@ -450,7 +450,7 @@ def _parse_bmap(self): # was SHA1. Version 2.0 started supporting arbitrary checksum # types. A new "ChecksumType" tag was introduce to specify the # checksum function name. And all XML tags which contained "sha1" - # in their name were renamed to something more neutral. This was an + # in their name were renamed to something more neutral. This was a # change incompatible with previous formats. # # There is a special format version 1.4, which should not have been @@ -523,7 +523,7 @@ def _update_progress(self, blocks_written): self._progress_file.write(progress) self._progress_file.flush() - # Update psplash progress when configured. This is using a best effort + # Update psplash progress when configured. This is using a best-effort # strategy to not affect the writing process when psplash breaks, is # not available early enough or screen is not available. if self._psplash_pipe and self.mapped_cnt: @@ -845,7 +845,7 @@ def __init__(self, image, dest, bmap=None, image_size=None): os.minor(st_rdev), ) - # Check if the 'queue' sub-directory exists. If yes, then our block + # Check if the 'queue' subdirectory exists. If yes, then our block # device is entire disk. Otherwise, it is a partition, in which case we # need to go one level up in the sysfs hierarchy. if not os.path.exists(self._sysfs_base + "queue"): @@ -872,7 +872,7 @@ def copy(self, sync=True, verify=True): # 1. Switch to the 'none' (the successor of 'noop' since the switch to # multiqueue schedulers) I/O scheduler if it is available - sequential # write to the block device becomes a lot faster comparing to CFQ. - # 2. Limit the write buffering - we do not need the kernel to buffer a lot of + # 2. Limit write buffering - we do not need the kernel to buffer a lot of # the data we send to the block device, because we write sequentially. # Excessive buffering would make some systems quite unresponsive. # This was observed e.g. in Fedora 17. From 91d3a58c40b8cff3d76b0d4cf10a878dda197187 Mon Sep 17 00:00:00 2001 From: Folker Schwesinger Date: Wed, 24 Apr 2024 18:36:02 +0200 Subject: [PATCH 2/8] BmapCreate: Fix typos Fix various typos in docstrings and in the XML comments included in a bmap file. Signed-off-by: Folker Schwesinger Signed-off-by: Joshua Watt --- src/bmaptool/BmapCreate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bmaptool/BmapCreate.py b/src/bmaptool/BmapCreate.py index 19d2787..f4e467c 100644 --- a/src/bmaptool/BmapCreate.py +++ b/src/bmaptool/BmapCreate.py @@ -18,7 +18,7 @@ This module implements the block map (bmap) creation functionality and provides the corresponding API in form of the 'BmapCreate' class. -The idea is that while images files may generally be very large (e.g., 4GiB), +The idea is that while image files may generally be very large (e.g., 4GiB), they may nevertheless contain only little real data, e.g., 512MiB. This data are files, directories, file-system meta-data, partition table, etc. When copying the image to the target device, you do not have to copy all the 4GiB of @@ -264,7 +264,7 @@ def _bmap_file_start(self): " \n" + xml += " (if present) is the checksum of this block range. -->\n" xml += " \n" # pylint: enable=C0301 From 709cec34ec9c364e3113841033245092fe4aaf4f Mon Sep 17 00:00:00 2001 From: Folker Schwesinger Date: Wed, 24 Apr 2024 18:37:13 +0200 Subject: [PATCH 3/8] BmapHelpers: Fix typo Fix a type in docstring of program_is_available(). Signed-off-by: Folker Schwesinger Signed-off-by: Joshua Watt --- src/bmaptool/BmapHelpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bmaptool/BmapHelpers.py b/src/bmaptool/BmapHelpers.py index e59aabd..8a3ccb4 100644 --- a/src/bmaptool/BmapHelpers.py +++ b/src/bmaptool/BmapHelpers.py @@ -88,7 +88,7 @@ def get_block_size(file_obj): def program_is_available(name): """ - This is a helper function which check if the external program 'name' is + This is a helper function which checks if the external program 'name' is available in the system. """ From b6cbcad1da4970a3164e75af3f282ea6c7683892 Mon Sep 17 00:00:00 2001 From: Folker Schwesinger Date: Fri, 26 Apr 2024 17:40:06 +0200 Subject: [PATCH 4/8] CLI: Fix typos Fix various typos in comments, docstrings and user facing strings. Signed-off-by: Folker Schwesinger Signed-off-by: Joshua Watt --- src/bmaptool/CLI.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/bmaptool/CLI.py b/src/bmaptool/CLI.py index 0306fda..5a0924b 100644 --- a/src/bmaptool/CLI.py +++ b/src/bmaptool/CLI.py @@ -238,7 +238,7 @@ def verify_detached_bmap_signature(args, bmap_obj, bmap_path): def verify_clearsign_bmap_signature(args, bmap_obj): """ This is a helper function for 'verify_bmap_signature()' which handles the - clarsign signature case. + clearsign signature case. """ if args.bmap_sig: @@ -307,7 +307,7 @@ def verify_bmap_signature(args, bmap_obj, bmap_path): In case of the clearsign signature, the bmap file has "invalid" format, meaning that the proper bmap XML contents is in the GPG clearsign container. The XML contents has to be extracted from the container before - further processing. And this is be done even if user specified the + further processing. And this is done even if user specified the --no-sig-verify option. This function returns an open file object with the extracted XML bmap file contents in this case. Otherwise, this function returns None. @@ -464,7 +464,7 @@ def open_files(args): # We just create the "/dev/misspelled" file, write the data there, and # report success. Later on the user finds out that the image was not really # written to the device, and gets confused. Similar confusion may happen if - # the destination file is not a special device for some reasons. + # the destination file is not a special device for some reason. if os.path.normpath(args.dest).startswith("/dev/"): if not os.path.exists(args.dest): log.warning( @@ -478,7 +478,7 @@ def open_files(args): ) # Try to open the destination file. If it does not exist, a new regular - # file will be created. If it exists and it is a regular file - it'll be + # file will be created. If it exists, and it is a regular file, it'll be # truncated. If this is a block device, it'll just be opened. dest_is_blkdev = False try: @@ -623,7 +623,7 @@ def create_command(args): target device. """ - # Create and setup the output stream + # Create and set up the output stream if args.output: try: output = open(args.output, "w+") @@ -724,7 +724,7 @@ def parse_arguments(): parser_copy.add_argument("--bmap-sig", help=text) # The --no-sig-verify option - text = "do not verify bmap file GPG signatrue" + text = "do not verify bmap file GPG signature" parser_copy.add_argument("--no-sig-verify", action="store_true", help=text) # The --no-verify option @@ -778,7 +778,7 @@ def __init__(self, fmt=None, datefmt=None): def format(self, record): """ - The formatter which which simply prefixes all debugging messages + The formatter which simply prefixes all debugging messages with a time-stamp. """ From 3cef241a647f88c90563a72a71ddc2c0c1b37014 Mon Sep 17 00:00:00 2001 From: Folker Schwesinger Date: Wed, 24 Apr 2024 18:41:05 +0200 Subject: [PATCH 5/8] Filemap: Fix typos Fix various typos in comments and docstrings. Signed-off-by: Folker Schwesinger Signed-off-by: Joshua Watt --- src/bmaptool/Filemap.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/bmaptool/Filemap.py b/src/bmaptool/Filemap.py index e517073..9792c0a 100644 --- a/src/bmaptool/Filemap.py +++ b/src/bmaptool/Filemap.py @@ -132,7 +132,7 @@ def _open_image_file(self): def block_is_mapped(self, block): # pylint: disable=W0613,R0201 """ - This method has has to be implemented by child classes. It returns + This method has to be implemented by child classes. It returns 'True' if block number 'block' of the image file is mapped and 'False' otherwise. """ @@ -141,7 +141,7 @@ def block_is_mapped(self, block): # pylint: disable=W0613,R0201 def block_is_unmapped(self, block): # pylint: disable=W0613,R0201 """ - This method has has to be implemented by child classes. It returns + This method has to be implemented by child classes. It returns 'True' if block number 'block' of the image file is not mapped (hole) and 'False' otherwise. """ @@ -150,7 +150,7 @@ def block_is_unmapped(self, block): # pylint: disable=W0613,R0201 def get_mapped_ranges(self, start, count): # pylint: disable=W0613,R0201 """ - This method has has to be implemented by child classes. This is a + This method has to be implemented by child classes. This is a generator which yields ranges of mapped blocks in the file. The ranges are tuples of 2 elements: [first, last], where 'first' is the first mapped block and 'last' is the last mapped block. @@ -163,7 +163,7 @@ def get_mapped_ranges(self, start, count): # pylint: disable=W0613,R0201 def get_unmapped_ranges(self, start, count): # pylint: disable=W0613,R0201 """ - This method has has to be implemented by child classes. Just like + This method has to be implemented by child classes. Just like 'get_mapped_ranges()', but yields unmapped block ranges instead (holes). """ @@ -181,7 +181,7 @@ def _lseek(file_obj, offset, whence): 'file_obj' and with specified 'offset' and 'whence'. The 'whence' argument is supposed to be either '_SEEK_DATA' or '_SEEK_HOLE'. When there is no more data or hole starting from 'offset', this function - returns '-1'. Otherwise the data or hole position is returned.""" + returns '-1'. Otherwise, the data or hole position is returned.""" try: return os.lseek(file_obj.fileno(), offset, whence) @@ -207,7 +207,7 @@ class FilemapSeek(_FilemapBase): """ def __init__(self, image): - """Refer the '_FilemapBase' class for the documentation.""" + """Refer to the '_FilemapBase' class for the documentation.""" # Call the base class constructor first _FilemapBase.__init__(self, image) @@ -259,7 +259,7 @@ def _probe_seek_hole(self): tmp_obj.close() def block_is_mapped(self, block): - """Refer the '_FilemapBase' class for the documentation.""" + """Refer to the '_FilemapBase' class for the documentation.""" offs = _lseek(self._f_image, block * self.block_size, _SEEK_DATA) if offs == -1: result = False @@ -270,7 +270,7 @@ def block_is_mapped(self, block): return result def block_is_unmapped(self, block): - """Refer the '_FilemapBase' class for the documentation.""" + """Refer to the '_FilemapBase' class for the documentation.""" return not self.block_is_mapped(block) def _get_ranges(self, start, count, whence1, whence2): @@ -301,7 +301,7 @@ def _get_ranges(self, start, count, whence1, whence2): yield (start_blk, end_blk) def get_mapped_ranges(self, start, count): - """Refer the '_FilemapBase' class for the documentation.""" + """Refer to the '_FilemapBase' class for the documentation.""" _log.debug( "FilemapSeek: get_mapped_ranges(%d, %d(%d))" % (start, count, start + count - 1) @@ -309,7 +309,7 @@ def get_mapped_ranges(self, start, count): return self._get_ranges(start, count, _SEEK_DATA, _SEEK_HOLE) def get_unmapped_ranges(self, start, count): - """Refer the '_FilemapBase' class for the documentation.""" + """Refer to the '_FilemapBase' class for the documentation.""" _log.debug( "FilemapSeek: get_unmapped_ranges(%d, %d(%d))" % (start, count, start + count - 1) @@ -336,8 +336,8 @@ def get_unmapped_ranges(self, start, count): # reading the block map _FIEMAP_FLAG_SYNC = 0x00000001 # Size of the buffer for 'struct fiemap_extent' elements which will be used -# when invoking the FIEMAP ioctl. The larger is the buffer, the less times the -# FIEMAP ioctl will be invoked. +# when invoking the FIEMAP ioctl. With a larger buffer, the FIEMAP ioctl will +# be invoked fewer times. _FIEMAP_BUFFER_SIZE = 256 * 1024 @@ -352,8 +352,8 @@ class FilemapFiemap(_FilemapBase): def __init__(self, image): """ - Initialize a class instance. The 'image' argument is full the file - object to operate on. + Initialize a class instance. The 'image' argument is the file object + to operate on. """ # Call the base class constructor first @@ -433,7 +433,7 @@ def _invoke_fiemap(self, block, count): return struct.unpack(_FIEMAP_FORMAT, self._buf[:_FIEMAP_SIZE]) def block_is_mapped(self, block): - """Refer the '_FilemapBase' class for the documentation.""" + """Refer to the '_FilemapBase' class for the documentation.""" struct_fiemap = self._invoke_fiemap(block, 1) # The 3rd element of 'struct_fiemap' is the 'fm_mapped_extents' field. @@ -444,7 +444,7 @@ def block_is_mapped(self, block): return result def block_is_unmapped(self, block): - """Refer the '_FilemapBase' class for the documentation.""" + """Refer to the '_FilemapBase' class for the documentation.""" return not self.block_is_mapped(block) def _unpack_fiemap_extent(self, index): @@ -505,7 +505,7 @@ def _do_get_mapped_ranges(self, start, count): block = extent_block + extent_count def get_mapped_ranges(self, start, count): - """Refer the '_FilemapBase' class for the documentation.""" + """Refer to the '_FilemapBase' class for the documentation.""" _log.debug( "FilemapFiemap: get_mapped_ranges(%d, %d(%d))" % (start, count, start + count - 1) @@ -531,7 +531,7 @@ def get_mapped_ranges(self, start, count): yield (first_prev, last_prev) def get_unmapped_ranges(self, start, count): - """Refer the '_FilemapBase' class for the documentation.""" + """Refer to the '_FilemapBase' class for the documentation.""" _log.debug( "FilemapFiemap: get_unmapped_ranges(%d, %d(%d))" % (start, count, start + count - 1) From 689a49fd054cab8b5939062368eabc02e2d3a8c1 Mon Sep 17 00:00:00 2001 From: Folker Schwesinger Date: Fri, 26 Apr 2024 17:41:42 +0200 Subject: [PATCH 6/8] TransRead: Fix typos Fix various typos in comments and docstrings. Signed-off-by: Folker Schwesinger Signed-off-by: Joshua Watt --- src/bmaptool/TransRead.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/bmaptool/TransRead.py b/src/bmaptool/TransRead.py index e3c4014..6c3c3ed 100644 --- a/src/bmaptool/TransRead.py +++ b/src/bmaptool/TransRead.py @@ -17,10 +17,10 @@ """ This module allows opening and reading local and remote files and decompress them on-the-fly if needed. Remote files are read using urllib (except of -"ssh://" URLs, which are handled differently). Supported file extentions are: +"ssh://" URLs, which are handled differently). Supported file extensions are: 'bz2', 'gz', 'xz', 'lzo', 'zst' and a "tar" version of them: 'tar.bz2', 'tbz2', 'tbz', 'tb2', 'tar.gz', 'tgz', 'tar.xz', 'txz', 'tar.lzo', 'tzo', 'tar.lz4', -'tlz4', '.tar.zst', 'tzst'. +'tlz4', 'tar.zst', 'zst'. This module uses the following system programs for decompressing: pbzip2, bzip2, gzip, pigz, xz, lzop, lz4, zstd, tar and unzip. """ @@ -230,8 +230,8 @@ def __del__(self): def _read_thread(self, f_from, f_to): """ This function is used when reading compressed files. It runs in a - spearate thread, reads data from the 'f_from' file-like object, and - writes them to the 'f_to' file-like object. 'F_from' may be a urllib + separate thread, reads data from the 'f_from' file-like object, and + writes them to the 'f_to' file-like object. 'F_from' may be an urllib object, while 'f_to' is usually stdin of the decompressor process. """ @@ -245,13 +245,13 @@ def _read_thread(self, f_from, f_to): f_to.write(buf) finally: # This will make sure the process decompressor gets EOF and exits, as - # well as ublocks processes waiting on decompressor's stdin. + # well as unblocks processes waiting on decompressor's stdin. f_to.close() def _open_compressed_file(self): """ Detect file compression type and open it with the corresponding - compression module, or just plain 'open() if the file is not + compression module, or just plain open() if the file is not compressed. """ @@ -478,7 +478,7 @@ def is_tar_zst(name): def _open_url_ssh(self, parsed_url): """ This function opens a file on a remote host using SSH. The URL has to - have this format: "ssh://username@hostname:path". Currently we only + have this format: "ssh://username@hostname:path". Currently, we only support password-based authentication. """ @@ -604,7 +604,7 @@ def _print_warning(timeout): _log.error(f"Error parsing line {e.lineno} of {e.filename}: {e.msg}") if username and password: - # Unfortunately, in order to handle URLs which contain user name + # Unfortunately, in order to handle URLs which contain username # and password (e.g., http://user:password@my.site.org), we need to # do few extra things. new_url = list(parsed_url) @@ -626,11 +626,11 @@ def _print_warning(timeout): urllib.request.install_opener(opener) # Open the URL. First try with a short timeout, and print a message - # which should supposedly give the a clue that something may be going + # which should supposedly give a clue that something may be going # wrong. # The overall purpose of this is to improve user experience. For - # example, if one tries to open a file but did not setup the proxy - # environment variables propely, there will be a very long delay before + # example, if one tries to open a file but did not set up the proxy + # environment variables properly, there will be a very long delay before # the failure message. And it is much nicer to pre-warn the user early # about something possibly being wrong. for timeout in (10, None): @@ -654,7 +654,7 @@ def _print_warning(timeout): def read(self, size=-1): """ - Read the data from the file or URL and and uncompress it on-the-fly if + Read the data from the file or URL and uncompress it on-the-fly if necessary. """ From a563f74515f1491447cc6c4a4443bc1cb98b00e5 Mon Sep 17 00:00:00 2001 From: Folker Schwesinger Date: Wed, 24 Apr 2024 18:49:03 +0200 Subject: [PATCH 7/8] tests: Fix typos Fix various typos in comments, docstrings and user-facing error messages in various test files. Signed-off-by: Folker Schwesinger Signed-off-by: Joshua Watt --- 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 @@ 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") @@ -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" @@ -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" @@ -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") @@ -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" @@ -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" @@ -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" 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 @@ 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. """ 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, From d63353d12b46cf1503238caacd581bbe41ee8a42 Mon Sep 17 00:00:00 2001 From: Joshua Watt Date: Tue, 28 May 2024 08:39:12 -0600 Subject: [PATCH 8/8] README: Fix pip install command The pip install command accidentally had `-m` when `-e` was intended. Also quote the argument for maximum shell compatibility Signed-off-by: Joshua Watt --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8251c02..c8f23f1 100644 --- a/README.md +++ b/README.md @@ -323,7 +323,7 @@ python3 -m venv .venv Next install the project in editable mode with development dependencies: ```bash -pip install -m .[dev] +pip install -e '.[dev]' ``` Finally, to run tests use `unittest`: