summaryrefslogtreecommitdiff
path: root/src/leap/common/testing
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2016-02-29 19:33:28 -0400
committerKali Kaneko <kali@leap.se>2016-02-29 19:39:43 -0400
commit027ad7eed50947608738ce0009fccf776936e55c (patch)
tree6777d80f097a06bd9c560b24fc886504a693fae8 /src/leap/common/testing
parent24977b744b42df912a23a2861453e7d4d5202310 (diff)
[tests] adapt events tests to recent changes
Diffstat (limited to 'src/leap/common/testing')
-rw-r--r--src/leap/common/testing/basetest.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/leap/common/testing/basetest.py b/src/leap/common/testing/basetest.py
index 3d3cee0..2e84a25 100644
--- a/src/leap/common/testing/basetest.py
+++ b/src/leap/common/testing/basetest.py
@@ -52,7 +52,7 @@ class BaseLeapTest(unittest.TestCase):
cls.tearDownEnv()
@classmethod
- def setUpEnv(cls):
+ def setUpEnv(cls, launch_events_server=True):
"""
Sets up common facilities for testing this TestCase:
- custom PATH and HOME environmental variables
@@ -72,14 +72,15 @@ class BaseLeapTest(unittest.TestCase):
os.environ["PATH"] = bin_tdir
os.environ["HOME"] = cls.tempdir
os.environ["XDG_CONFIG_HOME"] = os.path.join(cls.tempdir, ".config")
- cls._init_events()
+ if launch_events_server:
+ cls._init_events()
@classmethod
def _init_events(cls):
if flags.EVENTS_ENABLED:
cls._server = events_server.ensure_server(
- emit_addr="tcp://127.0.0.1:0",
- reg_addr="tcp://127.0.0.1:0")
+ emit_addr="tcp://127.0.0.1",
+ reg_addr="tcp://127.0.0.1")
events_client.configure_client(
emit_addr="tcp://127.0.0.1:%d" % cls._server.pull_port,
reg_addr="tcp://127.0.0.1:%d" % cls._server.pub_port)