Main Page
Namespaces
Classes
Files
File List
test
test_roslaunch_ros_args.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
# Software License Agreement (BSD License)
3
#
4
# Copyright (c) 2014, The Johns Hopkins University
5
# All rights reserved.
6
#
7
# Redistribution and use in source and binary forms, with or without
8
# modification, are permitted provided that the following conditions
9
# are met:
10
#
11
# * Redistributions of source code must retain the above copyright
12
# notice, this list of conditions and the following disclaimer.
13
# * Redistributions in binary form must reproduce the above
14
# copyright notice, this list of conditions and the following
15
# disclaimer in the documentation and/or other materials provided
16
# with the distribution.
17
# * Neither the name of Willow Garage, Inc. nor the names of its
18
# contributors may be used to endorse or promote products derived
19
# from this software without specific prior written permission.
20
#
21
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
# POSSIBILITY OF SUCH DAMAGE.
33
34
PKG =
'roslaunch'
35
NAME =
'test_roslaunch_ros_args'
36
37
import
os
38
import
sys
39
import
unittest
40
41
import
rostest
42
43
import
rospkg
44
import
roslaunch.arg_dump
45
46
class
TestRoslaunchRosArgs
(unittest.TestCase):
47
48
def
setUp
(self):
49
self.
vals
= set()
50
self.
msgs
= {}
51
52
def
test_roslaunch
(self):
53
rospack = rospkg.RosPack()
54
filename = os.path.join(rospack.get_path(
'test_roslaunch'
),
'test'
,
'ros_args.launch'
)
55
56
args = roslaunch.arg_dump.get_args([filename])
57
58
expected_args = {
59
'foo'
: (
"I pity the foo'."
,
'true'
),
60
'bar'
: (
"Someone walks into this."
,
None
,),
61
'baz'
: (
None
,
'false'
),
62
'nop'
: (
None
,
None
)}
63
64
self.assertEqual(args, expected_args)
65
66
if
__name__ ==
'__main__'
:
67
rostest.run(PKG, NAME, TestRoslaunchRosArgs, sys.argv)
test_roslaunch_ros_args.TestRoslaunchRosArgs.msgs
msgs
Definition:
test_roslaunch_ros_args.py:50
test_roslaunch_ros_args.TestRoslaunchRosArgs.test_roslaunch
def test_roslaunch(self)
Definition:
test_roslaunch_ros_args.py:52
test_roslaunch_ros_args.TestRoslaunchRosArgs.setUp
def setUp(self)
Definition:
test_roslaunch_ros_args.py:48
test_roslaunch_ros_args.TestRoslaunchRosArgs.vals
vals
Definition:
test_roslaunch_ros_args.py:49
test_roslaunch_ros_args.TestRoslaunchRosArgs
Definition:
test_roslaunch_ros_args.py:46
test_roslaunch
Author(s): Ken Conley, Dirk Thomas
autogenerated on Mon Nov 2 2020 03:52:53