From 7a4e3b342e3bfc93ab54336eb1b9bac825b13b70 Mon Sep 17 00:00:00 2001 From: Joshua Morton Date: Sun, 27 Aug 2017 21:08:46 -0400 Subject: [PATCH 1/2] Add a test for an unusued node. --- test/pyrostest/test_nodes.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/pyrostest/test_nodes.py b/test/pyrostest/test_nodes.py index 1e2a8ca..6bb270a 100644 --- a/test/pyrostest/test_nodes.py +++ b/test/pyrostest/test_nodes.py @@ -20,6 +20,11 @@ def test_add_one_node_many(self): sub.send(Int32(7)) assert out2.message.data == 8 + @pyrostest.launch_node('pyrostest', 'add_one.py') + def test_unused_node(self): + with self.mock_pub('/pub_val', Int32, queue_size=0) as sub: + with self.check_topic('/pyrostest/add_one', Int32) as out: + pass class TestPubFoo(pyrostest.RosTest): @pyrostest.with_launch_file('pyrostest', 'launch.launch') @@ -28,7 +33,6 @@ def test_foo_node(self): with self.check_topic('/pub_val', Int32) as out: assert out.message.data == 7 - class TestSequence(pyrostest.RosTest): @pyrostest.with_launch_file('pyrostest', 'launch.launch') @pyrostest.launch_node('pyrostest', 'pub_foo.py') From efcb19fd0d5b991e155a1d3b2ca9480c582ed8b8 Mon Sep 17 00:00:00 2001 From: Joshua Morton Date: Wed, 30 Aug 2017 02:43:03 -0400 Subject: [PATCH 2/2] Added spacing. --- test/pyrostest/test_nodes.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/pyrostest/test_nodes.py b/test/pyrostest/test_nodes.py index 6bb270a..e687cba 100644 --- a/test/pyrostest/test_nodes.py +++ b/test/pyrostest/test_nodes.py @@ -2,6 +2,7 @@ import pyrostest + class TestAddOne(pyrostest.RosTest): @pyrostest.launch_node('pyrostest', 'add_one.py') def test_add_one_node_single(self): @@ -26,6 +27,7 @@ def test_unused_node(self): with self.check_topic('/pyrostest/add_one', Int32) as out: pass + class TestPubFoo(pyrostest.RosTest): @pyrostest.with_launch_file('pyrostest', 'launch.launch') @pyrostest.launch_node('pyrostest', 'pub_foo.py') @@ -33,6 +35,7 @@ def test_foo_node(self): with self.check_topic('/pub_val', Int32) as out: assert out.message.data == 7 + class TestSequence(pyrostest.RosTest): @pyrostest.with_launch_file('pyrostest', 'launch.launch') @pyrostest.launch_node('pyrostest', 'pub_foo.py')