mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-16 07:33:16 +00:00
test(service): start nonexistent service
This commit is contained in:
parent
b9f3aa49bd
commit
a163718120
|
@ -93,6 +93,16 @@ allServices {
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
def assert_notfound(data):
|
||||||
|
assert_errorcode(data, 404)
|
||||||
|
|
||||||
|
|
||||||
|
def assert_errorcode(data, errorcode):
|
||||||
|
assert data["code"] == errorcode
|
||||||
|
assert data["success"] is False
|
||||||
|
assert data["message"] is not None
|
||||||
|
|
||||||
|
|
||||||
def api_enable(client, service: Service) -> dict:
|
def api_enable(client, service: Service) -> dict:
|
||||||
return api_enable_by_name(client, service.get_id())
|
return api_enable_by_name(client, service.get_id())
|
||||||
|
|
||||||
|
@ -221,6 +231,15 @@ def test_stop_return_value(authorized_client, only_dummy_service):
|
||||||
assert service["status"] == ServiceStatus.INACTIVE.value
|
assert service["status"] == ServiceStatus.INACTIVE.value
|
||||||
|
|
||||||
|
|
||||||
|
def test_start_nonexistent(authorized_client, only_dummy_service):
|
||||||
|
dummy_service = only_dummy_service
|
||||||
|
mutation_response = api_start_by_name(authorized_client, "bogus_service")
|
||||||
|
data = get_data(mutation_response)["services"]["startService"]
|
||||||
|
assert_notfound(data)
|
||||||
|
|
||||||
|
assert data["service"] is None
|
||||||
|
|
||||||
|
|
||||||
def test_stop_start(authorized_client, only_dummy_service):
|
def test_stop_start(authorized_client, only_dummy_service):
|
||||||
dummy_service = only_dummy_service
|
dummy_service = only_dummy_service
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue