From 0d7523c3093fe7394853505213ddc6f57c679fe4 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Thu, 28 Mar 2019 17:07:42 +0000 Subject: [PATCH] Use helpers in all tests. --- test/broker/06-bridge-b2br-late-connection-retain.py | 10 +--------- test/broker/06-bridge-b2br-late-connection.py | 10 +--------- test/broker/09-acl-access-variants.py | 10 +--------- 3 files changed, 3 insertions(+), 27 deletions(-) diff --git a/test/broker/06-bridge-b2br-late-connection-retain.py b/test/broker/06-bridge-b2br-late-connection-retain.py index 217bbca9..0a9a8562 100755 --- a/test/broker/06-bridge-b2br-late-connection-retain.py +++ b/test/broker/06-bridge-b2br-late-connection-retain.py @@ -2,15 +2,7 @@ # Does a bridge queue up retained messages correctly if the remote broker starts up late? -import socket - -import inspect, os, sys -# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder -cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) -if cmd_subfolder not in sys.path: - sys.path.insert(0, cmd_subfolder) - -import mosq_test +from mosq_test_helper import * def write_config1(filename, persistence_file, port1, port2): with open(filename, 'w') as f: diff --git a/test/broker/06-bridge-b2br-late-connection.py b/test/broker/06-bridge-b2br-late-connection.py index c21f3e55..e8a3d607 100755 --- a/test/broker/06-bridge-b2br-late-connection.py +++ b/test/broker/06-bridge-b2br-late-connection.py @@ -2,15 +2,7 @@ # Does a bridge queue up messages correctly if the remote broker starts up late? -import socket - -import inspect, os, sys -# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder -cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) -if cmd_subfolder not in sys.path: - sys.path.insert(0, cmd_subfolder) - -import mosq_test +from mosq_test_helper import * def write_config(filename, port1, port2): with open(filename, 'w') as f: diff --git a/test/broker/09-acl-access-variants.py b/test/broker/09-acl-access-variants.py index 406d8057..568f1147 100755 --- a/test/broker/09-acl-access-variants.py +++ b/test/broker/09-acl-access-variants.py @@ -2,15 +2,7 @@ # Check access - -import inspect, os, sys -# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder -cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) -if cmd_subfolder not in sys.path: - sys.path.insert(0, cmd_subfolder) - -import mosq_test -import signal +from mosq_test_helper import * def write_config(filename, port, per_listener): with open(filename, 'w') as f: