diff --git a/compliance_tool/aas_compliance_tool/cli.py b/compliance_tool/aas_compliance_tool/cli.py index 3563e746..54594598 100644 --- a/compliance_tool/aas_compliance_tool/cli.py +++ b/compliance_tool/aas_compliance_tool/cli.py @@ -19,11 +19,11 @@ from basyx.aas.adapter import aasx from basyx.aas.adapter.xml import write_aas_xml_file -from basyx.aas.compliance_tool import compliance_check_xml as compliance_tool_xml, \ - compliance_check_json as compliance_tool_json, compliance_check_aasx as compliance_tool_aasx +import compliance_check_xml as compliance_tool_xml, \ +compliance_check_json as compliance_tool_json, compliance_check_aasx as compliance_tool_aasx from basyx.aas.adapter.json import write_aas_json_file from basyx.aas.examples.data import create_example, create_example_aas_binding, TEST_PDF_FILE -from basyx.aas.compliance_tool.state_manager import ComplianceToolStateManager, Status +from .state_manager import ComplianceToolStateManager, Status def parse_cli_arguments() -> argparse.ArgumentParser: diff --git a/compliance_tool/test/test_aas_compliance_tool.py b/compliance_tool/test/test_aas_compliance_tool.py index 2eda44dd..c17a658f 100644 --- a/compliance_tool/test/test_aas_compliance_tool.py +++ b/compliance_tool/test/test_aas_compliance_tool.py @@ -14,7 +14,7 @@ import tempfile -import basyx.aas.compliance_tool +import compliance_tool from basyx.aas import model from basyx.aas.adapter import aasx from basyx.aas.adapter.json import read_aas_json_file @@ -25,14 +25,16 @@ def _run_compliance_tool(*compliance_tool_args, **kwargs) -> subprocess.CompletedProcess: """ - This function runs the compliance tool using subprocess.run() while adjusting the PYTHONPATH environment variable - and setting the stdout and stderr parameters of subprocess.run() to PIPE. + This function runs the compliance tool using subprocess.run() + and sets the stdout and stderr parameters of subprocess.run() to PIPE. Positional arguments are passed to the compliance tool, while keyword arguments are passed to subprocess.run(). """ env = os.environ.copy() - env['PYTHONPATH'] = "{}:{}".format(os.environ.get('PYTHONPATH', ''), - os.path.join(os.path.dirname(basyx.__file__), os.pardir)) - compliance_tool_path = os.path.join(os.path.dirname(basyx.aas.compliance_tool.__file__), 'cli.py') + compliance_tool_path = os.path.join( + os.path.dirname(os.path.dirname(__file__)), + 'aas_compliance_tool', + 'cli.py' + ) return subprocess.run([sys.executable, compliance_tool_path] + list(compliance_tool_args), stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env, **kwargs) diff --git a/compliance_tool/test/test_compliance_check_aasx.py b/compliance_tool/test/test_compliance_check_aasx.py index 575df1e4..0ab5da99 100644 --- a/compliance_tool/test/test_compliance_check_aasx.py +++ b/compliance_tool/test/test_compliance_check_aasx.py @@ -7,8 +7,8 @@ import os import unittest -from basyx.aas.compliance_tool import compliance_check_aasx as compliance_tool -from basyx.aas.compliance_tool.state_manager import ComplianceToolStateManager, Status +from compliance_tool.aas_compliance_tool import compliance_check_aasx as compliance_tool +from compliance_tool.aas_compliance_tool.state_manager import ComplianceToolStateManager, Status class ComplianceToolAASXTest(unittest.TestCase): diff --git a/compliance_tool/test/test_compliance_check_json.py b/compliance_tool/test/test_compliance_check_json.py index 16ebc5b7..2b761192 100644 --- a/compliance_tool/test/test_compliance_check_json.py +++ b/compliance_tool/test/test_compliance_check_json.py @@ -7,8 +7,8 @@ import os import unittest -import basyx.aas.compliance_tool.compliance_check_json as compliance_tool -from basyx.aas.compliance_tool.state_manager import ComplianceToolStateManager, Status +from compliance_tool.aas_compliance_tool import compliance_check_json as compliance_tool +from compliance_tool.aas_compliance_tool.state_manager import ComplianceToolStateManager, Status class ComplianceToolJsonTest(unittest.TestCase): diff --git a/compliance_tool/test/test_compliance_check_xml.py b/compliance_tool/test/test_compliance_check_xml.py index 24393bec..24f33f8f 100644 --- a/compliance_tool/test/test_compliance_check_xml.py +++ b/compliance_tool/test/test_compliance_check_xml.py @@ -7,8 +7,8 @@ import os import unittest -import basyx.aas.compliance_tool.compliance_check_xml as compliance_tool -from basyx.aas.compliance_tool.state_manager import ComplianceToolStateManager, Status +from compliance_tool.aas_compliance_tool import compliance_check_xml as compliance_tool +from compliance_tool.aas_compliance_tool.state_manager import ComplianceToolStateManager, Status class ComplianceToolXmlTest(unittest.TestCase): diff --git a/compliance_tool/test/test_state_manager.py b/compliance_tool/test/test_state_manager.py index 8557b7d7..753926b5 100644 --- a/compliance_tool/test/test_state_manager.py +++ b/compliance_tool/test/test_state_manager.py @@ -7,7 +7,7 @@ import logging import unittest -from basyx.aas.compliance_tool.state_manager import ComplianceToolStateManager, Status +from compliance_tool.aas_compliance_tool.state_manager import ComplianceToolStateManager, Status from basyx.aas.examples.data._helper import DataChecker