From d4ab819eb50839dfa4237bdba755c8a526cd5746 Mon Sep 17 00:00:00 2001 From: CasVT Date: Fri, 23 Jun 2023 00:18:03 +0200 Subject: [PATCH] Fixed test after improving API input validation --- tests/api_test.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/tests/api_test.py b/tests/api_test.py index b504492..f7906df 100644 --- a/tests/api_test.py +++ b/tests/api_test.py @@ -3,7 +3,7 @@ import unittest from flask import Blueprint from backend.custom_exceptions import * -from frontend.api import api, auth, error_handler, extract_key, return_api +from frontend.api import api, auth, error_handler, return_api class Test_API(unittest.TestCase): def test_blueprint(self): @@ -48,14 +48,4 @@ class Test_API(unittest.TestCase): result(TypeError) with self.assertRaises(KeyError): result(KeyError) - - def test_extract_key(self): - with self.assertRaises(KeyNotFound): - extract_key({'test': 'value'}, 'no_key') - self.assertIsNone(extract_key({'test': 'value'}, 'no_key', check_existence=False)) - with self.assertRaises(InvalidKeyValue): - extract_key({'time': ''}, 'time') - self.assertIsInstance(extract_key({'time': '1'}, 'time'), int) - - \ No newline at end of file