From 16de2a37737d3ac2be7b11459ed2f1891bd1b891 Mon Sep 17 00:00:00 2001 From: Annielated Date: Wed, 28 Apr 2021 23:49:40 +0200 Subject: [PATCH] . --- .idea/dbnavigator.xml | 572 ++++++++++++++++++ .../nest_backend/test/repository_edit_test.py | 27 + 2 files changed, 599 insertions(+) create mode 100644 .idea/dbnavigator.xml create mode 100644 code/backend/nest_backend/test/repository_edit_test.py diff --git a/.idea/dbnavigator.xml b/.idea/dbnavigator.xml new file mode 100644 index 0000000..2c9c2cc --- /dev/null +++ b/.idea/dbnavigator.xml @@ -0,0 +1,572 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + \ No newline at end of file diff --git a/code/backend/nest_backend/test/repository_edit_test.py b/code/backend/nest_backend/test/repository_edit_test.py new file mode 100644 index 0000000..cd7c24b --- /dev/null +++ b/code/backend/nest_backend/test/repository_edit_test.py @@ -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') + + + +