mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-05 11:03:12 +00:00
test(service): breakout raw api calls with ids
This commit is contained in:
parent
47cfaad160
commit
bd43bdb335
|
@ -63,22 +63,30 @@ allServices {
|
||||||
|
|
||||||
|
|
||||||
def api_start(client, service: Service) -> dict:
|
def api_start(client, service: Service) -> dict:
|
||||||
|
return api_start_by_name(client, service.get_id())
|
||||||
|
|
||||||
|
|
||||||
|
def api_start_by_name(client, service_id: str) -> dict:
|
||||||
response = client.post(
|
response = client.post(
|
||||||
"/graphql",
|
"/graphql",
|
||||||
json={
|
json={
|
||||||
"query": API_START_MUTATION,
|
"query": API_START_MUTATION,
|
||||||
"variables": {"service_id": service.get_id()},
|
"variables": {"service_id": service_id},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
||||||
def api_stop(client, service: Service) -> dict:
|
def api_stop(client, service: Service) -> dict:
|
||||||
|
return api_stop_by_name(client, service.get_id())
|
||||||
|
|
||||||
|
|
||||||
|
def api_stop_by_name(client, service_id: str) -> dict:
|
||||||
response = client.post(
|
response = client.post(
|
||||||
"/graphql",
|
"/graphql",
|
||||||
json={
|
json={
|
||||||
"query": API_STOP_MUTATION,
|
"query": API_STOP_MUTATION,
|
||||||
"variables": {"service_id": service.get_id()},
|
"variables": {"service_id": service_id},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
return response
|
return response
|
||||||
|
|
Loading…
Reference in a new issue