Skip to content
Snippets Groups Projects
Commit 51e080ce authored by Radko Krkoš's avatar Radko Krkoš
Browse files

Server/Tests: Centralize Server instance creation

parent 4f7ea2fb
No related branches found
No related tags found
No related merge requests found
...@@ -121,7 +121,6 @@ class Warden3ServerTest(unittest.TestCase): ...@@ -121,7 +121,6 @@ class Warden3ServerTest(unittest.TestCase):
"""High level Warden3 Server tests""" """High level Warden3 Server tests"""
config = {'log': {'level': 'debug'}, 'validator': {'type': 'NoValidator'}, 'auth': {'type': 'PlainAuthenticator'}, config = {'log': {'level': 'debug'}, 'validator': {'type': 'NoValidator'}, 'auth': {'type': 'PlainAuthenticator'},
'db': {'user': USER, 'password': PASSWORD, 'dbname': DB}, 'handler': {'description': 'Warden Test Server'}} 'db': {'user': USER, 'password': PASSWORD, 'dbname': DB}, 'handler': {'description': 'Warden Test Server'}}
app = build_server(config)
getInfo_interface_tests_specific = [ getInfo_interface_tests_specific = [
("/getInfo", "403 I'm watching. Authenticate."), ("/getInfo", "403 I'm watching. Authenticate."),
...@@ -139,6 +138,7 @@ class Warden3ServerTest(unittest.TestCase): ...@@ -139,6 +138,7 @@ class Warden3ServerTest(unittest.TestCase):
def setUpClass(cls): def setUpClass(cls):
"""Pre-test cleanup""" """Pre-test cleanup"""
cls.clean_lastid() cls.clean_lastid()
cls.app = build_server(cls.config)
@classmethod @classmethod
def clean_lastid(cls): def clean_lastid(cls):
...@@ -243,14 +243,12 @@ class X509AuthenticatorTest(Warden3ServerTest): ...@@ -243,14 +243,12 @@ class X509AuthenticatorTest(Warden3ServerTest):
"""Performs the basic test suite using the X509Authenticator""" """Performs the basic test suite using the X509Authenticator"""
config = deepcopy(Warden3ServerTest.config) config = deepcopy(Warden3ServerTest.config)
config['auth']['type'] = 'X509Authenticator' config['auth']['type'] = 'X509Authenticator'
app = build_server(config)
class X509NameAuthenticatorTest(Warden3ServerTest): class X509NameAuthenticatorTest(Warden3ServerTest):
"""Performs the basic test suite using the X509NameAuthenticator""" """Performs the basic test suite using the X509NameAuthenticator"""
config = deepcopy(Warden3ServerTest.config) config = deepcopy(Warden3ServerTest.config)
config['auth']['type'] = 'X509NameAuthenticator' config['auth']['type'] = 'X509NameAuthenticator'
app = build_server(config)
getInfo_interface_tests_specific = [ getInfo_interface_tests_specific = [
("/getInfo", "200 OK"), ("/getInfo", "200 OK"),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment