1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-25 06:24:19 +00:00

test dei metodi get e delete

This commit is contained in:
stefanogoldoni 2021-05-01 15:32:07 +02:00
parent 5df9053e91
commit 84b4c11e60

View file

@ -14,11 +14,11 @@ class MyTestCase(unittest.TestCase):
auth_code = j['data']['access_token']
# ritorno le info sulla repo speficicata dopo /repositories
r = requests.get(f'http://localhost:5000/api/v1/repositories/3', headers={'authorization': "Bearer " + auth_code})
r = requests.get(f'http://localhost:5000/api/v1/repositories/15', headers={'authorization': "Bearer " + auth_code})
j = json.loads(r.text)
assert j['result'] == "success"
r = requests.delete(f'http://localhost:5000/api/v1/repositories/1', headers={'authorization': "Bearer " + auth_code})
r = requests.delete(f'http://localhost:5000/api/v1/repositories/15', headers={'authorization': "Bearer " + auth_code})
j = json.loads(r.text)
assert j['result'] == 'success'