test(services): check id and status

This commit is contained in:
Houkime 2023-09-29 11:52:26 +00:00
parent 9bf239c3a8
commit 7808033bef

View file

@ -2,7 +2,7 @@ import pytest
from selfprivacy_api.graphql.mutations.services_mutations import ServicesMutations
import selfprivacy_api.services as service_module
from selfprivacy_api.services.service import Service
from selfprivacy_api.services.service import Service, ServiceStatus
import tests.test_graphql.test_api_backup
from tests.test_common import raw_dummy_service, dummy_service
@ -21,7 +21,6 @@ def only_dummy_service(dummy_service):
service_module.services.extend(back_copy)
API_START_MUTATION = """
mutation TestStartService($service_id: String!) {
services {
@ -103,4 +102,9 @@ def api_service(authorized_client, service: Service):
def test_get_services(authorized_client, only_dummy_service):
assert len(api_all_services(authorized_client)) == 1
services = api_all_services(authorized_client)
assert len(services) == 1
api_dummy_service = services[0]
assert api_dummy_service["id"] == "testservice"
assert api_dummy_service["status"] == ServiceStatus.ACTIVE.value