test against local launchfile more robust

This commit is contained in:
Thibault Kruse 2012-03-24 17:14:01 +00:00
parent f36ac103df
commit 20997ffac0
2 changed files with 7 additions and 3 deletions

View File

@ -0,0 +1,3 @@
<launch>
<!-- file exists just for completion purposes -->
</launch>

View File

@ -47,12 +47,13 @@ class TestWithFiles(unittest.TestCase):
subprocess.check_call("touch foo.launch", shell=True, cwd=self.test_root_path)
subprocess.check_call("touch bar.launch", shell=True, cwd=self.test_root_path)
cmd = make_bash_pre_command(['roslaunch', 'roslaunch'], 2)
cmd += "_roscomplete_launch roslaunch roslaunch; echo $COMPREPLY'"
cmd = make_bash_pre_command(['rosbash', 'rosbash'], 2)
cmd += "_roscomplete_launch rosbash rosbash; echo $COMPREPLY'"
p = subprocess.Popen(cmd,
shell=True,
stdout=subprocess.PIPE,
cwd=self.test_root_path)
output = p.communicate()
self.assertEqual(0, p.returncode, (p.returncode, output, cmd))
self.assertEqual('example.launch\n', output[0], (p.returncode, output[0], cmd))
self.assertTrue('example.launch' in output[0], (p.returncode, output[0], cmd))