Browse Source

some tests

ash 2 years ago
parent
commit
e4001f18ea
3 changed files with 7 additions and 2 deletions
  1. 1 1
      Backend/Sources/View/view_manager.py
  2. 6 1
      Backend/Tests/core_test.py
  3. BIN
      Backend/requirements.txt

+ 1 - 1
Backend/Sources/View/view_manager.py

@@ -133,7 +133,7 @@ def login():
         return resp
 
 
-@__app__.route('/api/logout',methods = ['POST'])
+@__app__.route('/api/logout',methods = ['DELETE'])
 def logout():
     logger.info("account " + session["username"] + " logged OUT with id : " + session["client_id"])
     session.clear()

+ 6 - 1
Backend/Tests/core_test.py

@@ -64,9 +64,14 @@ def test_inventory() :
     print(r.__dict__)
     assert r.status_code == 200
 
+    r = s.post("http://127.0.0.1:8000/inventory/item",json={"assign_date_epoch": 5000, "assigned": True, "brand": "Mikrotik", "name": "RB2011", "note": "saline RT 2, chez ashvin", "owned": True, "serial_number": "12345678", "tags": "#router #mikrotik #saline", "type": "router", "wear_score": 100})
+    print(r.__dict__)
+    assert r.status_code == 200
 
 
-
+    r = s.get("http://127.0.0.1:8000/inventory/items")
+    print(r.__dict__)
+    assert r.status_code == 200
 
 
 

BIN
Backend/requirements.txt