From 36189731625b87cc1860f51baf8b7632ca7ece9f Mon Sep 17 00:00:00 2001 From: Anton B Date: Fri, 7 Aug 2020 11:54:54 +0100 Subject: [PATCH] Initialise _endpoints_map in the client since it is requested by default session (#72) Modify tests to invoke session so such cases are caught Co-authored-by: Anton Benkevich --- almdrlib/config.py | 1 + tests/test_open_api_support.py | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/almdrlib/config.py b/almdrlib/config.py index 9db3bb0..28ef05c 100644 --- a/almdrlib/config.py +++ b/almdrlib/config.py @@ -53,6 +53,7 @@ def __init__(self, endpoint_map_file=None, residency=None): self._config_file = os.environ.get('ALERTLOGIC_CONFIG') + self._endpoint_map = None if self._config_file is None: self._config_file = almdrlib.constants.DEFAULT_CONFIG_FILE diff --git a/tests/test_open_api_support.py b/tests/test_open_api_support.py index 5e9b28e..1810ffe 100644 --- a/tests/test_open_api_support.py +++ b/tests/test_open_api_support.py @@ -8,6 +8,7 @@ from almdrlib.session import Session from almdrlib.client import Client +from almdrlib.client import Config from almdrlib.client import Operation from alsdkdefs import OpenAPIKeyWord @@ -76,3 +77,9 @@ def test_002_test_operations_schema(self): operation_content = schema[OpenAPIKeyWord.CONTENT] for name, value in t_operation_content.items(): self.assertEqual(value, operation_content[name]) + + def test_003_default_objects_creation(self): + """Checks initialisation at least happens""" + self.assertIsInstance(Session(), Session) + self.assertIsInstance(Config(), Config) + self.assertIsInstance(Client(self._service_name), Client)