diff --git a/code/backend/nest_backend/test/repository_edit_test.py b/code/backend/nest_backend/test/repository_edit_test.py deleted file mode 100644 index cd7c24b..0000000 --- a/code/backend/nest_backend/test/repository_edit_test.py +++ /dev/null @@ -1,27 +0,0 @@ -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') - - - - diff --git a/code/backend/nest_backend/test/repository_test.py b/code/backend/nest_backend/test/repository_test.py new file mode 100644 index 0000000..642c5c6 --- /dev/null +++ b/code/backend/nest_backend/test/repository_test.py @@ -0,0 +1,32 @@ +import json +import unittest +import requests + + +class MyTestCase(unittest.TestCase): + def test_repository_edit(self): + global auth_code + + # eseguo il login + r = requests.post('http://localhost:5000/api/v1/login', json={'email': 'admin@admin.com', 'password': 'password'}) + j = json.loads(r.text) + assert j['result'] == "success" + 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}) + #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}) + j = json.loads(r.text) + assert j['result'] == 'success' + + + + +print('Testing del metodo repository_edit') + + + + diff --git a/code/backend/nest_backend/test/user_delete_test.py b/code/backend/nest_backend/test/user_delete_test.py index bb83b20..36322b6 100644 --- a/code/backend/nest_backend/test/user_delete_test.py +++ b/code/backend/nest_backend/test/user_delete_test.py @@ -49,6 +49,7 @@ class MyTestCase(unittest.TestCase): j = json.loads(r.text) assert j['result'] == "success" + # TODO AGGIUNGERE TESTING DI GET E PATCH print("User_delete eseguito correttamente!") print("Testing del metodo user delete")