From 86ed277f3114d9f7ccf3cbbd6e46b304e49c3e5b Mon Sep 17 00:00:00 2001 From: Giovanni Anniballi <253150@studenti.unimore.it> Date: Sun, 2 May 2021 16:03:19 +0000 Subject: [PATCH] update repository_test --- code/backend/nest_backend/test/repository_test.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/backend/nest_backend/test/repository_test.py b/code/backend/nest_backend/test/repository_test.py index 5a96e28..f2cbfae 100644 --- a/code/backend/nest_backend/test/repository_test.py +++ b/code/backend/nest_backend/test/repository_test.py @@ -13,15 +13,17 @@ class MyTestCase(unittest.TestCase): assert j['result'] == "success" auth_code = j['data']['access_token'] - '''# ritorno le info sulla repo speficicata dopo /repositories + # ritorno le info sulla repository speficicata r = requests.get(f'http://localhost:5000/api/v1/repositories/17', headers={'authorization': "Bearer " + auth_code}) j = json.loads(r.text) assert j['result'] == "success" + # cancello la repository specificata r = requests.delete(f'http://localhost:5000/api/v1/repositories/17', headers={'authorization': "Bearer " + auth_code}) j = json.loads(r.text) - assert j['result'] == "success"''' + assert j['result'] == "success" + # modifico il nome e lo stato della repository specificata r = requests.patch(f'http://localhost:5000/api/v1/repositories/16', headers={'authorization': "Bearer " + auth_code}, json={'name': 'newname', 'open': True}) j = json.loads(r.text)