From 3a7c3ec2f9f07291a3ce9d2b89c77fae963abde5 Mon Sep 17 00:00:00 2001 From: drebs Date: Mon, 20 Nov 2017 11:53:36 -0200 Subject: [test] avoid failing when there's no couch_url in environment variable --- tests/server/test_tac.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'tests/server') diff --git a/tests/server/test_tac.py b/tests/server/test_tac.py index 1ebe3308..7f52481c 100644 --- a/tests/server/test_tac.py +++ b/tests/server/test_tac.py @@ -68,12 +68,14 @@ class TacServerTestCase(unittest.TestCase): twistd = os.path.join(path, 'bin', 'twistd') args = [twistd, '--pidfile=', '-noy', TAC_FILE_PATH] - # Use a special environment when running twistd. + # run Users API on port 2424 without TLS + env = {'DEBUG_SERVER': 'yes'} + + # allow passing of couch url using environment variable, used by gitlab + # ci with docker couch_url = os.environ.get('SOLEDAD_COUCH_URL') - env = { - 'DEBUG_SERVER': 'yes', # run Users API on port 2424 without TLS - 'SOLEDAD_COUCH_URL': couch_url, # used by gitlab ci with docker - } + if couch_url: + env.update({'SOLEDAD_COUCH_URL': couch_url}) protocol = ProcessProtocol() proc = reactor.spawnProcess(protocol, twistd, args, env=env) -- cgit v1.2.3