2 PKG =
'ez_interactive_marker' 3 import roslib; roslib.load_manifest(PKG)
11 tpf = tempfile.NamedTemporaryFile()
12 f = open(tpf.name,
'w')
13 f.write(
'{"test": 1}')
15 src =
'{value: !include %s}' % tpf.name
16 dst = ec.yaml.load(src)
17 self.assertEqual(dst[
'value'], {
'test': 1})
20 src =
'{value: !enum [visualization_msgs/Marker, CUBE]}' 21 dst = ec.yaml.load(src)
22 self.assertEqual(dst[
'value'], 1)
25 src =
'{value: !degrees 180.0}' 26 dst = ec.yaml.load(src)
27 self.assertAlmostEqual(dst[
'value'], np.pi)
30 src =
'{value: !euler [0.0, 0.0, 0.0]}' 31 dst = ec.yaml.load(src)
32 self.assertAlmostEqual(dst[
'value'][
'x'], 0.0)
33 self.assertAlmostEqual(dst[
'value'][
'y'], 0.0)
34 self.assertAlmostEqual(dst[
'value'][
'z'], 0.0)
35 self.assertAlmostEqual(dst[
'value'][
'w'], 1.0)
37 if __name__ ==
'__main__':
39 rostest.rosrun(PKG,
'test_config_parser', TestConfigParser)
def test_load_include(self)
def test_load_euler(self)
def test_load_degrees(self)