Skip to content

Commit

Permalink
updated for additional changes with design_instance_id
Browse files Browse the repository at this point in the history
  • Loading branch information
philipjusher committed Feb 19, 2024
1 parent ec5a599 commit f39f776
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/ansys/conceptev/core/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ def get_token() -> str:
return response.json()["accessToken"]


def get_http_client(token: str, concept_id: str | None = None) -> httpx.Client:
def get_http_client(token: str, design_instance_id: str | None = None) -> httpx.Client:
"""Get a http client.
This http client creates and maintains the connection and is more performant than
re-creating that connection for each call.
"""
base_url = os.environ["CONCEPTEV_URL"]
if concept_id:
params = {"concept_id": concept_id}
params = {"design_instance_id": design_instance_id}
else:
params = None
return httpx.Client(headers={"Authorization": token}, params=params, base_url=base_url)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def test_get_token(httpx_mock: HTTPXMock):
@pytest.fixture
def client():
fake_token = "value1"
concept_id = "123"
client = main.get_http_client(fake_token, concept_id=concept_id)
design_instance_id = "123"
client = main.get_http_client(fake_token, design_instance_id=design_instance_id)
return client


Expand Down

0 comments on commit f39f776

Please sign in to comment.