From dff346eedb341009a3b6df8edb72ad4cf1a93f98 Mon Sep 17 00:00:00 2001 From: soksanichenko Date: Thu, 28 Apr 2022 16:44:47 +0300 Subject: [PATCH] - Unit tests are fixed --- pungi/scripts/gather_modules.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pungi/scripts/gather_modules.py b/pungi/scripts/gather_modules.py index 8c19e95f..507d9a39 100644 --- a/pungi/scripts/gather_modules.py +++ b/pungi/scripts/gather_modules.py @@ -12,6 +12,9 @@ import createrepo_c as cr from typing.io import BinaryIO +EMPTY_FILE = '.empty' + + def _is_compressed_file(first_two_bytes: bytes, initial_bytes: bytes): return binascii.hexlify(first_two_bytes) == initial_bytes @@ -67,7 +70,7 @@ def collect_modules(modules_paths: List[BinaryIO], target_dir: str): os.makedirs(module_defaults_path, exist_ok=True) # Defaults modules can be empty, but pungi detects # empty folder while copying and raises the exception in this case - Path(os.path.join(module_defaults_path, '.empty')).touch() + Path(os.path.join(module_defaults_path, EMPTY_FILE)).touch() for module_file in modules_paths: data = module_file.read()