Skip to content

Commit

Permalink
Initialise _endpoints_map in the client since it is requested by defa…
Browse files Browse the repository at this point in the history
…ult session (#72)

Modify tests to invoke session so such cases are caught

Co-authored-by: Anton Benkevich <[email protected]>
  • Loading branch information
2 people authored and Anton Benkevich committed Aug 7, 2020
1 parent 487a5b5 commit 3618973
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions almdrlib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 7 additions & 0 deletions tests/test_open_api_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)

0 comments on commit 3618973

Please sign in to comment.