From ba4b17757b3185d95ecd6190f12da1bd2287d049 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Fri, 24 May 2024 11:12:02 +0200 Subject: [PATCH] Fixing setup.py and test/test_01_config.py because of changing lib dir. --- setup.py | 6 +++--- test/test_01_config.py | 16 ++++++++++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/setup.py b/setup.py index 94896c4..7384d15 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ from setuptools import setup __base_dir__ = os.path.abspath(os.path.dirname(__file__)) __bin_dir__ = os.path.join(__base_dir__, 'bin') __lib_dir__ = os.path.join(__base_dir__, 'lib') -__module_dir__ = os.path.join(__lib_dir__, 'cr_tf') +__module_dir__ = os.path.join(__lib_dir__, 'create_terraform') __init_py__ = os.path.join(__module_dir__, '__init__.py') __postinst_scriptdir__ = pathlib.Path(__base_dir__) / 'postinstall-scripts' __keys_dir__ = pathlib.Path(__base_dir__) / 'keys' @@ -49,11 +49,11 @@ def pp(obj): if os.path.exists(__module_dir__) and os.path.isfile(__init_py__): sys.path.insert(0, os.path.abspath(__lib_dir__)) -import cr_tf +import create_terraform ENCODING = "utf-8" -__packet_version__ = cr_tf.__version__ +__packet_version__ = create_terraform.__version__ __packet_name__ = 'create_terraform' diff --git a/test/test_01_config.py b/test/test_01_config.py index bd8d58c..8847f3b 100755 --- a/test/test_01_config.py +++ b/test/test_01_config.py @@ -3,14 +3,15 @@ ''' @author: Frank Brehm @contact: frank@brehm-online.com -@copyright: © 2019 Frank Brehm, Berlin +@copyright: © 2024 Frank Brehm, Berlin @license: GPL3 @summary: test script (and module) for unit tests on config module ''' +import logging import os import sys -import logging +import textwrap try: import unittest2 as unittest @@ -46,11 +47,14 @@ class TestCreateTerraformConfig(CreateTerraformTestcase): # ------------------------------------------------------------------------- def test_import(self): - LOG.info("Testing import of cr_tf.config ...") - import cr_tf.config # noqa + LOG.info("Testing import of create_terraform.config ...") + import create_terraform.config + LOG.debug('Version of create_terraform.config: {!r}'.format( + create_terraform.config.__version__)) - LOG.info("Testing import of VsphereConfig from cr_tf.config ...") - from cr_tf.config import VsphereConfig # noqa + LOG.info("Testing import of VsphereConfig from create_terraform.config ...") + from create_terraform.config import VsphereConfig + LOG.debug('Description of VsphereConfig: ' + textwrap.dedent(VsphereConfig.__doc__)) # ============================================================================= -- 2.39.5