From 4f7ea2fb62c8b962be099d238977f90ff0de8981 Mon Sep 17 00:00:00 2001 From: Radko Krkos <krkos@cesnet.cz> Date: Tue, 28 Aug 2018 19:22:36 +0200 Subject: [PATCH] Server/Tests: Use deepcopy to clone config Fixes wrong references in embedded (dict in dict) class variables outside the class variable definition context, for redefined inherited class variables. --- warden_server/test_warden_server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/warden_server/test_warden_server.py b/warden_server/test_warden_server.py index 8a6807c..4355407 100755 --- a/warden_server/test_warden_server.py +++ b/warden_server/test_warden_server.py @@ -7,6 +7,7 @@ import getpass import sys import warnings from os import path +from copy import deepcopy import unittest2 as unittest import MySQLdb as my from warden_server import build_server @@ -240,14 +241,14 @@ class Warden3ServerTest(unittest.TestCase): class X509AuthenticatorTest(Warden3ServerTest): """Performs the basic test suite using the X509Authenticator""" - config = dict(Warden3ServerTest.config) + config = deepcopy(Warden3ServerTest.config) config['auth']['type'] = 'X509Authenticator' app = build_server(config) class X509NameAuthenticatorTest(Warden3ServerTest): """Performs the basic test suite using the X509NameAuthenticator""" - config = dict(Warden3ServerTest.config) + config = deepcopy(Warden3ServerTest.config) config['auth']['type'] = 'X509NameAuthenticator' app = build_server(config) -- GitLab