diff options
author | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-09-16 11:21:01 +0200 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-09-16 11:21:01 +0200 |
commit | d4e4d3dc8ff88d98477e1fcd1104d7cd8b9e6612 (patch) | |
tree | c33e49fb699c05eeee4bfefcb012a8f3d4e9630c | |
parent | 9d0900de85d07ec5b7926708c51136810b337158 (diff) |
[tests] Make txclient honor flags.EVENTS_ENABLED
- Breaks tests in dependent repos like soledad otherwise,
because server.key could not be found
-rw-r--r-- | src/leap/common/events/txclient.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/leap/common/events/txclient.py b/src/leap/common/events/txclient.py index dfd0533..be4b3ef 100644 --- a/src/leap/common/events/txclient.py +++ b/src/leap/common/events/txclient.py @@ -35,7 +35,7 @@ from leap.common.events.client import EventsClient from leap.common.events.client import configure_client from leap.common.events.server import EMIT_ADDR from leap.common.events.server import REG_ADDR -from leap.common.events import catalog +from leap.common.events import catalog, flags logger = logging.getLogger(__name__) @@ -146,8 +146,9 @@ def register(event, callback, uid=None, replace=False): :raises CallbackAlreadyRegisteredError: when there's already a callback identified by the given uid and replace is False. """ - return EventsTxClient.instance().register( - event, callback, uid=uid, replace=replace) + if flags.EVENTS_ENABLED: + return EventsTxClient.instance().register( + event, callback, uid=uid, replace=replace) def unregister(event, uid=None): @@ -162,7 +163,8 @@ def unregister(event, uid=None): :param uid: The callback uid. :type uid: str """ - return EventsTxClient.instance().unregister(event, uid=uid) + if flags.EVENTS_ENABLED: + return EventsTxClient.instance().unregister(event, uid=uid) def emit(event, *content): @@ -174,7 +176,8 @@ def emit(event, *content): :param content: The content of the event. :type content: list """ - return EventsTxClient.instance().emit(event, *content) + if flags.EVENTS_ENABLED: + return EventsTxClient.instance().emit(event, *content) def shutdown(): |