Skip to content

Configuration defaults captures OSPARC_* #149

@pcrespov

Description

@pcrespov

User Story

The Configuration object should by default capture specific environment variables. such that by open a jupyter-math service in osparc (see ITISFoundation/jupyter-math#29, ITISFoundation/osparc-simcore#5695)

from osparc import ApiClient, UsersApi, Confirmation
import os

cfg = Configuration()
print(cfg.host)

with ApiClient(cfg) as api_client:
    users_api = UsersApi(api_client)
    profile = users_api.get_my_profile()
    print(profile)

Definition of Done

from osparc import ApiClient, UsersApi, Confirmation
import os

@pytest.fixture
def mock_osparc_service_envs(monkeypatch):
    # emulate osparc variable and secrets mechanism here where starting a service
    ...


def test_done(mock_osparc_service_envs):
  assert Configuration() = Configuration(
      host=os.environ["OSPARC_API_HOST"],
      username=os.environ["OSPARC_API_KEY"],
      password=os.environ["OSPARC_API_SECRET"],
  )

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions