Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration defaults captures OSPARC_* #149

Open
pcrespov opened this issue Apr 19, 2024 · 0 comments
Open

Configuration defaults captures OSPARC_* #149

pcrespov opened this issue Apr 19, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@pcrespov
Copy link
Member

pcrespov commented Apr 19, 2024

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"],
  )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants