mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-25 14:34:19 +00:00
incompleto
This commit is contained in:
parent
ff64b2edac
commit
78fd695210
1 changed files with 27 additions and 0 deletions
27
code/backend/nest_backend/test/repository_edit_test.py
Normal file
27
code/backend/nest_backend/test/repository_edit_test.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
import json
|
||||
import unittest
|
||||
import requests
|
||||
|
||||
|
||||
class MyTestCase(unittest.TestCase):
|
||||
def test_repository_edit(self):
|
||||
global auth_code
|
||||
|
||||
r = requests.post('http://localhost:5000/api/login', json={'email': 'admin@admin.com', 'password': 'password'})
|
||||
j = json.loads(r.text)
|
||||
assert j['result'] == "success"
|
||||
auth_code = j['data']['access_token']
|
||||
|
||||
r = requests.put(f'http://localhost:5000/api/repository/edit', headers={'authorization': "Bearer " + auth_code},
|
||||
json={'id': '1', 'name': 'newname'})
|
||||
j = json.loads(r.text)
|
||||
assert j['result'] == "success"
|
||||
|
||||
print('Repository_edit eseguito correttamente!')
|
||||
|
||||
|
||||
print('Testing del metodo repository_edit')
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in a new issue