diff --git a/src/cache.py b/src/cache.py index 06d7ba4a..4fa53ded 100644 --- a/src/cache.py +++ b/src/cache.py @@ -15,8 +15,17 @@ from testgres.operations.local_ops import LocalOperations from testgres.operations.os_ops import OsOperations +import typing -def cached_initdb(data_dir, logfile=None, params=None, os_ops: OsOperations = None, bin_path=None, cached=True): + +def cached_initdb( + data_dir, + logfile=None, + params=None, + os_ops: typing.Optional[OsOperations] = None, + bin_path=None, + cached=True, +): """ Perform initdb or use cached node files. """ diff --git a/src/node.py b/src/node.py index d13630e9..79761d96 100644 --- a/src/node.py +++ b/src/node.py @@ -861,6 +861,7 @@ def _collect_special_files(self) -> typing.List[typing.Tuple[str, bytes]]: continue file_lines = self._os_ops.readlines(f, num_lines, binary=True, encoding=None) + assert type(file_lines) is bytes lines = b''.join(file_lines) # fill list @@ -1010,6 +1011,7 @@ def normalize_line(line_str): # We collect a list of rules that already exist in the file (in the form of word lists) existing_normalized = [] for s in hba_conf_file: + assert type(s) is str s_clean = s.strip() if s_clean and not s_clean.startswith("#"): existing_normalized.append(normalize_line(s_clean))