Commit 393421d6 authored by Qarnot computing's avatar Qarnot computing

Some mocks for SLARC and VCG for integrationt tests

parent f2e0f3e1
......@@ -222,7 +222,7 @@ class VCTagMapper(ABC):
class VCTagMapperFake(VCTagMapper):
async def vc_tag_for_itl(self, itl: ITLoad) -> str:
return 'vc-tag_' + itl.uuid
return itl.uuid
class VCTagMapperHttp(VCTagMapper):
......
......@@ -128,18 +128,22 @@ class SLARCClientFake(SLARCClient):
# Also, we'll only generate the 'downtime' SLO as it's the only one that will
# be used by upper level anyway.
slo = SLO(id='00000000-1111-1111-1111-111111111111' + itl.uuid, objective='downtime',
# target_value=10, current_value=10 - int(itl.uuid[-1:]), unit='minutes', status='active')
target_value=10, current_value=int(itl.uuid[-1:]), unit='minutes', status='active')
slo_8c = SLO(id='83e5ca70-29ee-455c-8dc7-9a5606750fec' + itl.uuid, objective='downtime',
target_value=10, current_value=1, unit='minutes', status='active')
slo_2c = SLO(id='bb8778f3-3249-4c3a-a73b-0d71a7c97d8b' + itl.uuid, objective='downtime',
target_value=10, current_value=1, unit='minutes', status='active')
slo_1c = SLO(id='babc8f62-f33e-4b06-85a3-559ff7232839' + itl.uuid, objective='downtime',
target_value=10, current_value=1, unit='minutes', status='active')
sla_status = SLAStatus(id='00000000-2222-2222-2222-222222222222', entity_type='uuid',
entity_id=itl.uuid, valid_from=datetime.now(timezone.utc), valid_until=datetime.now(timezone.utc),
status='active', slos=[slo])
status='active', slos=[slo_8c, slo_2c, slo_1c])
return sla_status
class SLARCClientHttp(SLARCClient):
def __init__(self, remote_endpoint):
self._remote_endpoint = remote_endpoint
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment