Fix Python indent

This commit is contained in:
Christophe Bedard 2019-06-17 10:20:15 +02:00
parent f5871e1141
commit 8704f0591d
8 changed files with 60 additions and 51 deletions

View file

@ -20,12 +20,13 @@ class TestNode(unittest.TestCase):
session_name_prefix = 'session-test-node-creation' session_name_prefix = 'session-test-node-creation'
test_node = ['test_publisher'] test_node = ['test_publisher']
exit_code, full_path = run_and_trace(BASE_PATH, exit_code, full_path = run_and_trace(
session_name_prefix, BASE_PATH,
node_creation_events, session_name_prefix,
None, node_creation_events,
PKG, None,
test_node) PKG,
test_node)
self.assertEqual(exit_code, 0) self.assertEqual(exit_code, 0)
trace_events = get_trace_event_names(full_path) trace_events = get_trace_event_names(full_path)

View file

@ -19,12 +19,13 @@ class TestPublisher(unittest.TestCase):
session_name_prefix = 'session-test-publisher-creation' session_name_prefix = 'session-test-publisher-creation'
test_node = ['test_publisher'] test_node = ['test_publisher']
exit_code, full_path = run_and_trace(BASE_PATH, exit_code, full_path = run_and_trace(
session_name_prefix, BASE_PATH,
publisher_creation_events, session_name_prefix,
None, publisher_creation_events,
PKG, None,
test_node) PKG,
test_node)
self.assertEqual(exit_code, 0) self.assertEqual(exit_code, 0)
trace_events = get_trace_event_names(full_path) trace_events = get_trace_event_names(full_path)

View file

@ -20,12 +20,13 @@ class TestService(unittest.TestCase):
session_name_prefix = 'session-test-service-creation' session_name_prefix = 'session-test-service-creation'
test_nodes = ['test_service'] test_nodes = ['test_service']
exit_code, full_path = run_and_trace(BASE_PATH, exit_code, full_path = run_and_trace(
session_name_prefix, BASE_PATH,
service_creation_events, session_name_prefix,
None, service_creation_events,
PKG, None,
test_nodes) PKG,
test_nodes)
self.assertEqual(exit_code, 0) self.assertEqual(exit_code, 0)
trace_events = get_trace_event_names(full_path) trace_events = get_trace_event_names(full_path)

View file

@ -20,12 +20,13 @@ class TestServiceCallback(unittest.TestCase):
session_name_prefix = 'session-test-service-callback' session_name_prefix = 'session-test-service-callback'
test_nodes = ['test_service_ping', 'test_service_pong'] test_nodes = ['test_service_ping', 'test_service_pong']
exit_code, full_path = run_and_trace(BASE_PATH, exit_code, full_path = run_and_trace(
session_name_prefix, BASE_PATH,
service_callback_events, session_name_prefix,
None, service_callback_events,
PKG, None,
test_nodes) PKG,
test_nodes)
self.assertEqual(exit_code, 0) self.assertEqual(exit_code, 0)
trace_events = get_trace_event_names(full_path) trace_events = get_trace_event_names(full_path)

View file

@ -20,12 +20,13 @@ class TestSubscription(unittest.TestCase):
session_name_prefix = 'session-test-subscription-creation' session_name_prefix = 'session-test-subscription-creation'
test_node = ['test_subscription'] test_node = ['test_subscription']
exit_code, full_path = run_and_trace(BASE_PATH, exit_code, full_path = run_and_trace(
session_name_prefix, BASE_PATH,
subscription_creation_events, session_name_prefix,
None, subscription_creation_events,
PKG, None,
test_node) PKG,
test_node)
self.assertEqual(exit_code, 0) self.assertEqual(exit_code, 0)
trace_events = get_trace_event_names(full_path) trace_events = get_trace_event_names(full_path)

View file

@ -20,12 +20,13 @@ class TestSubscriptionCallback(unittest.TestCase):
session_name_prefix = 'session-test-subscription-callback' session_name_prefix = 'session-test-subscription-callback'
test_nodes = ['test_ping', 'test_pong'] test_nodes = ['test_ping', 'test_pong']
exit_code, full_path = run_and_trace(BASE_PATH, exit_code, full_path = run_and_trace(
session_name_prefix, BASE_PATH,
subscription_callback_events, session_name_prefix,
None, subscription_callback_events,
PKG, None,
test_nodes) PKG,
test_nodes)
self.assertEqual(exit_code, 0) self.assertEqual(exit_code, 0)
trace_events = get_trace_event_names(full_path) trace_events = get_trace_event_names(full_path)

View file

@ -22,12 +22,13 @@ class TestTimer(unittest.TestCase):
session_name_prefix = 'session-test-timer-all' session_name_prefix = 'session-test-timer-all'
test_nodes = ['test_timer'] test_nodes = ['test_timer']
exit_code, full_path = run_and_trace(BASE_PATH, exit_code, full_path = run_and_trace(
session_name_prefix, BASE_PATH,
timer_events, session_name_prefix,
None, timer_events,
PKG, None,
test_nodes) PKG,
test_nodes)
self.assertEqual(exit_code, 0) self.assertEqual(exit_code, 0)
trace_events = get_trace_event_names(full_path) trace_events = get_trace_event_names(full_path)

View file

@ -16,12 +16,13 @@ from tracetools_trace.tools.lttng import (
) )
def run_and_trace(base_path, def run_and_trace(
session_name_prefix, base_path,
ros_events, session_name_prefix,
kernel_events, ros_events,
package_name, kernel_events,
node_names): package_name,
node_names):
""" """
Run a node while tracing. Run a node while tracing.
@ -41,9 +42,10 @@ def run_and_trace(base_path,
nodes = [] nodes = []
for node_name in node_names: for node_name in node_names:
n = launch_ros.actions.Node(package=package_name, n = launch_ros.actions.Node(
node_executable=node_name, package=package_name,
output='screen') node_executable=node_name,
output='screen')
nodes.append(n) nodes.append(n)
ld = LaunchDescription(nodes) ld = LaunchDescription(nodes)
ls = LaunchService() ls = LaunchService()