Commit 383e5dbf authored by Ilias Tsitsimpis's avatar Ilias Tsitsimpis Committed by Christos Stavrakakis
Browse files

Unit test user_catalogs without POST method

parent 2f95d284
......@@ -135,8 +135,16 @@ def _reqAuthenticate(conn, method, url, **kwargs):
def _reqCatalogs(conn, method, url, **kwargs):
"""Return user catalogs"""
# XXX: not implemented yet
return [{}]
global token_1, token_2, user_1, user_2
if conn.__class__.__name__ != "HTTPSConnection":
return _requestStatus302(conn, method, url, **kwargs)
if method != "POST":
return _requestStatus400(conn, method, url, **kwargs)
# XXX:
return (200, {})
# ----------------------------
......@@ -364,6 +372,28 @@ class TestCallAstakos(unittest.TestCase):
"""Test _postAuthenticate using pool"""
# ----------------------------------
# Test the response if we request user_catalogs with GET
def _getUserCatalogs(self, pool):
global token_1
token_1, "", use_pool=pool)
except Exception as (status, data):
if status != 400:"Should have returned 400 (Method not allowed)")
else:"Should have returned 400 (Method not allowed)")
def test_GetUserCatalogs(self):
"""Test _getUserCatalogs without pool"""
def test_GetUserCatalogsPool(self):
"""Test _getUserCatalogs using pool"""
class TestAuthenticate(unittest.TestCase):
"""Test cases for function authenticate"""
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment