From 3276a6385925d7e0fe2a72204c3381255216bc21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=B2=D0=B0=D0=BD=D0=BE=D0=B2=20=D0=94=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=81?= Date: Wed, 30 Sep 2020 09:48:50 +0300 Subject: [PATCH] All work on multible package templates is removed. --- calculate/variables/loader.py | 6 +++--- tests/templates/test_directory_processor.py | 14 -------------- .../test_runner/install/.calculate_directory | 2 +- .../test_runner/remove/.calculate_directory | 2 +- .../test_runner/update/.calculate_directory | 2 +- .../db/pkg/test-category/test-package-1.0/CONTENTS | 4 ++-- 6 files changed, 8 insertions(+), 22 deletions(-) diff --git a/calculate/variables/loader.py b/calculate/variables/loader.py index 58948ae..fda6378 100644 --- a/calculate/variables/loader.py +++ b/calculate/variables/loader.py @@ -749,11 +749,11 @@ class Datavars: def _load_package(self, package_name): '''Метод для загрузки переменных содержащихся в указанном пакете.''' - self.output.set_info("Loading package '{}'".format(package_name)) + self.output.set_info("Loading datavars package '{}'".format(package_name)) try: self._loader.load_variables_package(package_name) except Exception as error: - raise VariableError("Can not load variables package: {}". + raise VariableError("Can not load datavars package: {}". format(error)) def __getattr__(self, package_name: str): @@ -766,7 +766,7 @@ class Datavars: self.root.add_namespace(custom_namespace) return self.root[package_name] elif package_name not in self._available_packages: - raise VariableNotFoundError("variables package '{}' is not found". + raise VariableNotFoundError("datavars package '{}' is not found". format(package_name)) else: self._load_package(package_name) diff --git a/tests/templates/test_directory_processor.py b/tests/templates/test_directory_processor.py index c246f44..51f1d19 100644 --- a/tests/templates/test_directory_processor.py +++ b/tests/templates/test_directory_processor.py @@ -894,20 +894,6 @@ class TestDirectoryProcessor: 'etc/dir_35/file_0')) assert '/etc/dir_35/file_0' in test_package - # def test_multiple_package_value(self): - # datavars.main['cl_template_path'] = os.path.join(CHROOT_PATH, - # 'templates_34') - # directory_processor = DirectoryProcessor(['install', 'update'], - # datavars_module=datavars) - # directory_processor.process_template_directories() - # test_package = Package(test_package_name, chroot_path=CHROOT_PATH) - - # assert os.path.exists(join_paths(CHROOT_PATH, - # 'etc/dir_36')) - # assert os.path.exists(join_paths(CHROOT_PATH, - # 'etc/dir_36/file_0')) - # assert '/etc/dir_36/file_0' in test_package - def test_view_tree(self): list_path = join_paths(CHROOT_PATH, '/etc') show_tree(list_path) diff --git a/tests/templates/testfiles/test_runner/install/.calculate_directory b/tests/templates/testfiles/test_runner/install/.calculate_directory index 353f912..9ef11b6 100644 --- a/tests/templates/testfiles/test_runner/install/.calculate_directory +++ b/tests/templates/testfiles/test_runner/install/.calculate_directory @@ -1,2 +1,2 @@ {% calculate append = 'skip', action = 'install' %} -{% calculate path = '/home/divanov/Home/protected/test_dir' %} +{% calculate path = '/var/calculate/development/dir/test_dir' %} diff --git a/tests/templates/testfiles/test_runner/remove/.calculate_directory b/tests/templates/testfiles/test_runner/remove/.calculate_directory index d360ee2..a9e78a9 100644 --- a/tests/templates/testfiles/test_runner/remove/.calculate_directory +++ b/tests/templates/testfiles/test_runner/remove/.calculate_directory @@ -1,2 +1,2 @@ {% calculate append = 'skip', action = 'remove' %} -{% calculate path = '/home/divanov/Home/protected' %} +{% calculate path = '/var/calculate/development/dir' %} diff --git a/tests/templates/testfiles/test_runner/update/.calculate_directory b/tests/templates/testfiles/test_runner/update/.calculate_directory index 0e91b87..697e9a3 100644 --- a/tests/templates/testfiles/test_runner/update/.calculate_directory +++ b/tests/templates/testfiles/test_runner/update/.calculate_directory @@ -1,2 +1,2 @@ {% calculate append = 'skip', action = 'update' %} -{% calculate path = '/home/divanov/Home/protected/test_dir' %} +{% calculate path = '/var/calculate/development/dir/test_dir' %} diff --git a/tests/templates/testfiles/test_wrapper_root/var/db/pkg/test-category/test-package-1.0/CONTENTS b/tests/templates/testfiles/test_wrapper_root/var/db/pkg/test-category/test-package-1.0/CONTENTS index 263b533..241d43c 100644 --- a/tests/templates/testfiles/test_wrapper_root/var/db/pkg/test-category/test-package-1.0/CONTENTS +++ b/tests/templates/testfiles/test_wrapper_root/var/db/pkg/test-category/test-package-1.0/CONTENTS @@ -6,6 +6,6 @@ obj /etc/dir/deleted.json 11e3a79fe51cce828d973dba8702adaa 1591356795 dir /etc/dir/subdir obj /etc/dir/subdir/config.json 506649cf099878124deda2c2452c3693 1591605050 obj /etc/dir/subdir/file 84bcceb2c8e6de79849ea5f3304f2411 1591343236 -obj /etc/dir/file.conf 0b87fea7f5b65cac5012baa2bf647e72 1601290690 +obj /etc/dir/file.conf 0b87fea7f5b65cac5012baa2bf647e72 1601363686 dir /etc/dir/dir_1 -obj /etc/dir/dir_1/config.json 506649cf099878124deda2c2452c3693 1601290690 +obj /etc/dir/dir_1/config.json 506649cf099878124deda2c2452c3693 1601363686