From cc26d64a41933289665948f0fdaaa8d35a050514 Mon Sep 17 00:00:00 2001 From: frgfm Date: Fri, 19 Mar 2021 10:18:10 +0100 Subject: [PATCH 1/2] fix: Fixed device payload in end-to-end script --- scripts/api_e2e.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/api_e2e.py b/scripts/api_e2e.py index 76b42c40..de19e704 100644 --- a/scripts/api_e2e.py +++ b/scripts/api_e2e.py @@ -67,7 +67,7 @@ def main(args): # Create a device (as admin until #79 is closed) device_login = 'my_device' device_pwd = 'my_third_password' - payload = dict(login=device_login, password=device_pwd, specs="raspberry_pi") + payload = dict(login=device_login, password=device_pwd, specs="raspberry_pi", angle_of_view=0.68) device_id = api_request('post', f"{api_url}/devices/register", user_auth, payload)['id'] device_auth = { From b6c3c7f6c662a02fa90acc2268f45bedd802f9c1 Mon Sep 17 00:00:00 2001 From: frgfm Date: Fri, 19 Mar 2021 10:18:23 +0100 Subject: [PATCH 2/2] feat: Added proper cleanup of e2e script --- scripts/api_e2e.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/api_e2e.py b/scripts/api_e2e.py index de19e704..073c3a17 100644 --- a/scripts/api_e2e.py +++ b/scripts/api_e2e.py @@ -101,9 +101,11 @@ def main(args): # Cleaning (order is important because of foreign key protection in existing tables) api_request('delete', f"{api_url}/alerts/{alert_id1}/", superuser_auth) api_request('delete', f"{api_url}/alerts/{alert_id2}/", superuser_auth) + api_request('delete', f"{api_url}/events/{event_id}/", superuser_auth) api_request('delete', f"{api_url}/media/{media_id}/", superuser_auth) api_request('delete', f"{api_url}/installations/{installation_id}/", superuser_auth) api_request('delete', f"{api_url}/devices/{device_id}/", superuser_auth) + api_request('delete', f"{api_url}/sites/{site_id}/", superuser_auth) api_request('delete', f"{api_url}/users/{user_id}/", superuser_auth) print(f"SUCCESS in {time.time() - start_ts:.3}s")