Skip to content

Commit f8ca9fd

Browse files
authored
Merge pull request #56 from grycap/tests
Add DummyEnvironment for tests
2 parents 7f4d557 + 3773751 commit f8ca9fd

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

adim/models/allocation.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,14 @@ class KubernetesEnvironment(BaseModel):
8282
host: HttpUrl
8383

8484

85+
class DummyEnvironment(BaseModel):
86+
"""Dummy environment for testing purposes"""
87+
kind: Literal['DummyEnvironment'] = 'DummyEnvironment'
88+
89+
8590
AllocationValue = Annotated[
8691
Union[
92+
DummyEnvironment,
8793
OpenStackEnvironment,
8894
EGIComputeEnvironment,
8995
KubernetesEnvironment,

adim/utils/deployment_manager.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ def get_im_auth_header(
9090
cloud_auth_data["type"] = "Kubernetes"
9191
cloud_auth_data["host"] = str(allocation.host)
9292
cloud_auth_data["token"] = token
93+
elif allocation.kind == "DummyEnvironment":
94+
cloud_auth_data["type"] = "Dummy"
9395
else:
9496
raise ValueError("Allocation kind not supported")
9597
auth_data.append(cloud_auth_data)

0 commit comments

Comments
 (0)