42 from xmlrpc.client
import DateTime
44 from xmlrpclib
import DateTime
51 from roslib.names
import make_global_ns, ns_join
53 from rosclient
import TestRosClient
62 def _setParam(self, ctx, myState, testVals, master):
63 ctx = make_global_ns(ctx)
64 for type, vals
in testVals:
66 callerId = ns_join(ctx,
"node")
69 key =
"%s-%s"%(type,count)
71 master.setParam(callerId, key, val)
72 self.assert_(self.apiSuccess(master.hasParam(callerId, key)))
73 trueKey = ns_join(ctx, key)
74 myState[trueKey] = val
77 assert "getParam failed on type[%s], val[%s]"%(type,val)
83 for (k, v)
in myState.items():
84 assert self.apiSuccess(master.hasParam(callerId, k))
87 v2 = self.apiSuccess(master.getParam(callerId, k))
89 raise Exception(
"Exception raised while calling master.getParam(%s,%s): %s"%(callerId, k, traceback.format_exc()))
90 if isinstance(v2, DateTime):
91 self.assertEquals(DateTime(v), v2,
"[%s]: %s != %s, %s"%(k, v, v2, v2.__class__))
92 elif type(v2) == float:
93 self.assertAlmostEqual(v, v2, 3,
"[%s]: %s != %s, %s"%(k, v, v2, v2.__class__))
95 self.assertEquals(v, v2)
96 paramNames = myState.keys()
97 remoteParamNames = self.apiSuccess(master.getParamNames(callerId))
99 remoteParamNames = [p
for p
in remoteParamNames
if not p
in [
'/run_id',
'/rosdistro',
'/rosversion']]
100 remoteParamNames = [p
for p
in remoteParamNames
if not p.startswith(
'/roslaunch/')]
102 assert not set(paramNames) ^ set(remoteParamNames),
"parameter server keys do not match local: %s"%(set(paramNames)^set(remoteParamNames))
109 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/new_param')))
110 self.apiSuccess(master.setParam(caller_id,
'/new_param', 1))
111 self.assert_(self.apiSuccess(master.hasParam(caller_id,
'/new_param')))
113 self.assert_(self.apiSuccess(master.hasParam(caller_id,
'new_param')))
116 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/sub/sub2/new_param2')))
118 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/sub/sub2/')))
119 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/sub/sub2')))
120 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/sub/')))
121 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/sub')))
122 self.apiSuccess(master.setParam(caller_id,
'/sub/sub2/new_param2', 1))
123 self.assert_(self.apiSuccess(master.hasParam(caller_id,
'/sub/sub2/new_param2')))
125 self.assert_(self.apiSuccess(master.hasParam(caller_id,
'/sub/sub2/')))
126 self.assert_(self.apiSuccess(master.hasParam(caller_id,
'/sub/sub2')))
127 self.assert_(self.apiSuccess(master.hasParam(caller_id,
'/sub/')))
128 self.assert_(self.apiSuccess(master.hasParam(caller_id,
'/sub')))
130 self.assert_(self.apiSuccess(master.hasParam(caller_id,
'sub/sub2/new_param2')))
131 self.assert_(self.apiSuccess(master.hasParam(
'/sub/node',
'sub2/new_param2')))
132 self.assert_(self.apiSuccess(master.hasParam(
'/sub/sub2/node',
'new_param2')))
133 self.assert_(self.apiSuccess(master.hasParam(
'/sub/node',
'sub2')))
134 self.assert_(self.apiSuccess(master.hasParam(
'/node',
'sub')))
142 val1 = {
'level1_p1': random.randint(0, 10000),
143 'level1_p2' : {
'level2_p2': random.randint(0, 10000) }}
144 val2 = {
'level1_p1': random.randint(0, 10000),
145 'level1_p2' : {
'level2_p2': random.randint(0, 10000) }}
146 val3 = {
'level1_p1': random.randint(0, 10000),
147 'level1_p2' : {
'level2_p2': random.randint(0, 10000) }}
148 val4 = {
'level1_p1': random.randint(0, 10000),
149 'level1_p2' : {
'level2_p2': random.randint(0, 10000) }}
154 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/param')))
155 self.apiSuccess(master.setParam(caller_id,
'/param', val1))
157 self.assertEquals(
'/param', self.apiSuccess(master.searchParam(caller_id,
'param')))
159 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/level1/param')))
160 self.apiSuccess(master.setParam(caller_id,
'/level1/param', val2))
161 self.assertEquals(val2, self.apiSuccess(master.getParam(caller_id,
'/level1/param')))
163 self.assertEquals(
'/param',
164 self.apiSuccess(master.searchParam(caller_id,
'param')))
165 self.assertEquals(
'/level1/param',
166 self.apiSuccess(master.searchParam(
'/level1/node',
'param')))
168 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/level1/level2/param')))
169 self.apiSuccess(master.setParam(caller_id,
'/level1/level2/param', val3))
171 self.assertEquals(
'/param',
172 self.apiSuccess(master.searchParam(caller_id,
'param')))
173 self.assertEquals(
'/level1/param',
174 self.apiSuccess(master.searchParam(
'/level1/node',
'param')))
175 self.assertEquals(
'/level1/level2/param',
176 self.apiSuccess(master.searchParam(
'/level1/level2/node',
'param')))
177 self.assertEquals(
'/level1/level2/param',
178 self.apiSuccess(master.searchParam(
'/level1/level2/level3/level4/node',
'param')))
180 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/level1/level2/level3/level4/param')))
181 self.apiSuccess(master.setParam(caller_id,
'/level1/level2/level3/level4/param', val4))
183 self.assertEquals(
'/param',
184 self.apiSuccess(master.searchParam(caller_id,
'param')))
185 self.assertEquals(
'/level1/param',
186 self.apiSuccess(master.searchParam(
'/level1/node',
'param')))
187 self.assertEquals(
'/level1/level2/param',
188 self.apiSuccess(master.searchParam(
'/level1/level2/node',
'param')))
189 self.assertEquals(
'/level1/level2/param',
190 self.apiSuccess(master.searchParam(
'/level1/level2/level3/node',
'param')))
191 self.assertEquals(
'/level1/level2/level3/level4/param',
192 self.apiSuccess(master.searchParam(
'/level1/level2/level3/level4/node',
'param')))
195 self.assertEquals(
'/param', self.apiSuccess(master.searchParam(
'/not/level1/level2/level3/level4/node',
'param')))
197 tests = [(
'/param',
'/not/level1/level2/level3/level4/node'),
198 (
'/level1/param',
'/level1/node'),
199 (
'/level1/param',
'/level1/notlevel2/notlevel3/node'),
200 (
'/level1/level2/param',
'/level1/level2/node'),
201 (
'/level1/level2/param',
'/level1/level2/level3/node'),
202 (
'/level1/level2/param',
'/level1/level2/notlevel3/notlevel3/node'),
203 (
'/level1/level2/level3/level4/param',
'/level1/level2/level3/level4/node'),
204 (
'/level1/level2/level3/level4/param',
'/level1/level2/level3/level4/l5/l6/node'),
206 for pbase, caller_id
in tests:
207 self.assertEquals(pbase +
'/level1_p1',
208 self.apiSuccess(master.searchParam(caller_id,
'param/level1_p1')))
209 key = pbase+
'/level1_p2/level2_p2' 210 self.assertEquals(key,
211 self.apiSuccess(master.searchParam(caller_id,
'param/level1_p2/level2_p2')))
214 if self.apiSuccess(master.hasParam(caller_id, key)):
215 self.apiSuccess(master.deleteParam(caller_id, key))
216 self.assertEquals(key,
217 self.apiSuccess(master.searchParam(caller_id,
'param/level1_p2/level2_p2')))
219 self.assertEquals(pbase +
'/non_existent',
220 self.apiSuccess(master.searchParam(caller_id,
'param/non_existent')))
221 self.assertEquals(pbase +
'/level1_p2/non_existent',
222 self.apiSuccess(master.searchParam(caller_id,
'param/level1_p2/non_existent')))
227 for k
in [
'run_id',
'roslaunch',
'rosversion',
'rosdistro']:
236 val = random.randint(0, 10000)
241 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/new_param')))
242 self.apiSuccess(master.setParam(caller_id,
'/new_param', val))
243 full_dict[
'new_param'] = val
244 self.assertEquals(val, self.apiSuccess(master.getParam(caller_id,
'/new_param')))
246 self.assertEquals(val, self.apiSuccess(master.getParam(caller_id,
'new_param')))
248 ps_full_dict = self.apiSuccess(master.getParam(caller_id,
'/'))
251 self.assertEquals(full_dict, ps_full_dict)
254 val = random.randint(0, 10000)
255 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/sub/sub2/new_param2')))
256 self.apiSuccess(master.setParam(caller_id,
'/sub/sub2/new_param2', val))
257 full_dict[
'sub'] = {
'sub2': {
'new_param2': val }}
258 self.assertEquals(val, self.apiSuccess(master.getParam(caller_id,
'/sub/sub2/new_param2')))
260 self.assertEquals(val, self.apiSuccess(master.getParam(caller_id,
'sub/sub2/new_param2')))
261 self.assertEquals(val, self.apiSuccess(master.getParam(
'/sub/node',
'sub2/new_param2')))
262 self.assertEquals(val, self.apiSuccess(master.getParam(
'/sub/sub2/node',
'new_param2')))
264 self.assertEquals(val, self.apiSuccess(master.getParam(
'/foo/bar/baz/blah/node',
'/sub/sub2/new_param2')))
266 ps_full_dict = self.apiSuccess(master.getParam(caller_id,
'/'))
268 self.assertEquals(full_dict, ps_full_dict)
272 val1 = random.randint(0, 10000)
273 val2 = random.randint(0, 10000)
274 val3 = random.randint(0, 10000)
276 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/gains/P')))
277 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/gains/I')))
278 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/gains/D')))
279 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/gains')))
281 self.apiSuccess(master.setParam(caller_id,
'/gains/P', val1))
282 self.apiSuccess(master.setParam(caller_id,
'/gains/I', val2))
283 self.apiSuccess(master.setParam(caller_id,
'/gains/D', val3))
285 pid = {
'P': val1,
'I': val2,
'D': val3}
286 full_dict[
'gains'] = pid
287 self.assertEquals(pid,
288 self.apiSuccess(master.getParam(caller_id,
'/gains')))
289 self.assertEquals(pid,
290 self.apiSuccess(master.getParam(caller_id,
'/gains/')))
291 ps_full_dict = self.apiSuccess(master.getParam(caller_id,
'/'))
293 self.assertEquals(full_dict, ps_full_dict)
295 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/ns/gains/P')))
296 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/ns/gains/I')))
297 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/ns/gains/D')))
298 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/ns/gains')))
300 self.apiSuccess(master.setParam(caller_id,
'/ns/gains/P', val1))
301 self.apiSuccess(master.setParam(caller_id,
'/ns/gains/I', val2))
302 self.apiSuccess(master.setParam(caller_id,
'/ns/gains/D', val3))
303 full_dict[
'ns'] = {
'gains': pid}
305 self.assertEquals(pid,
306 self.apiSuccess(master.getParam(caller_id,
'/ns/gains')))
307 self.assertEquals({
'gains': pid},
308 self.apiSuccess(master.getParam(caller_id,
'/ns/')))
309 self.assertEquals({
'gains': pid},
310 self.apiSuccess(master.getParam(caller_id,
'/ns')))
311 ps_full_dict = self.apiSuccess(master.getParam(caller_id,
'/'))
313 self.assertEquals(full_dict, ps_full_dict)
320 val = random.randint(0, 10000)
323 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/new_param')))
324 self.apiSuccess(master.setParam(caller_id,
'/new_param', val))
325 self.assertEquals(val, self.apiSuccess(master.getParam(caller_id,
'/new_param')))
327 self.assertEquals(val, self.apiSuccess(master.getParam(caller_id,
'new_param')))
330 vals = [
'a', {
'a':
'b'}, 1, 1.,
'foo', {
'c':
'd'}, 4]
332 self.apiSuccess(master.setParam(caller_id,
'/multi/multi_param', v))
333 self.assertEquals(v, self.apiSuccess(master.getParam(caller_id,
'multi/multi_param')))
336 val = random.randint(0, 10000)
337 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/sub/sub2/new_param2')))
338 self.apiSuccess(master.setParam(caller_id,
'/sub/sub2/new_param2', val))
339 self.assertEquals(val, self.apiSuccess(master.getParam(caller_id,
'/sub/sub2/new_param2')))
341 self.assertEquals(val, self.apiSuccess(master.getParam(caller_id,
'sub/sub2/new_param2')))
342 self.assertEquals(val, self.apiSuccess(master.getParam(
'/sub/node',
'sub2/new_param2')))
343 self.assertEquals(val, self.apiSuccess(master.getParam(
'/sub/sub2/node',
'new_param2')))
346 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/gains/P')))
347 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/gains/I')))
348 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/gains/D')))
349 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/gains')))
351 pid = {
'P': random.randint(0, 10000),
'I': random.randint(0, 10000),
'D': random.randint(0, 10000)}
352 self.apiSuccess(master.setParam(caller_id,
'/gains', pid))
353 self.assertEquals(pid, self.apiSuccess(master.getParam(caller_id,
'/gains')))
354 self.assertEquals(pid[
'P'], self.apiSuccess(master.getParam(caller_id,
'/gains/P')))
355 self.assertEquals(pid[
'I'], self.apiSuccess(master.getParam(caller_id,
'/gains/I')))
356 self.assertEquals(pid[
'D'], self.apiSuccess(master.getParam(caller_id,
'/gains/D')))
358 subns = {
'gains1': pid,
'gains2': pid}
359 self.apiSuccess(master.setParam(caller_id,
'/ns', subns))
360 self.assertEquals(pid[
'P'], self.apiSuccess(master.getParam(caller_id,
'/ns/gains1/P')))
361 self.assertEquals(pid[
'I'], self.apiSuccess(master.getParam(caller_id,
'/ns/gains1/I')))
362 self.assertEquals(pid[
'D'], self.apiSuccess(master.getParam(caller_id,
'/ns/gains1/D')))
363 self.assertEquals(pid, self.apiSuccess(master.getParam(caller_id,
'/ns/gains1')))
364 self.assertEquals(pid, self.apiSuccess(master.getParam(caller_id,
'/ns/gains2')))
365 self.assertEquals(subns, self.apiSuccess(master.getParam(caller_id,
'/ns/')))
368 self.apiSuccess(master.setParam(caller_id,
'/ns', {}))
370 self.assert_(self.apiSuccess(master.hasParam(caller_id,
'/ns/')))
372 self.assertEquals({}, self.apiSuccess(master.getParam(caller_id,
'/ns/')))
374 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/ns/gains1')))
375 self.failIf(self.apiSuccess(master.hasParam(caller_id,
'/ns/gains1/P')))
381 from xmlrpc.client
import Binary
383 from xmlrpclib
import Binary
384 str_of_bytes =
''.join([chr(n)
for n
in range(0, 255)])
385 if not isinstance(str_of_bytes, bytes):
386 str_of_bytes = bytes(range(255))
388 [
'int', [0, 1024, 2147483647, -2147483647]],
389 [
'boolean', [
True,
False]],
392 [
'unicode-string', [
u'',
u'hello', b
'Andr\302\202'.decode(
'utf-8'), b
'\377\376A\000n\000d\000r\000\202\000'.decode(
'utf-16')]],
393 [
'string-easy-ascii', [chr(n)
for n
in range(32, 128)]],
398 [
'string', [
'',
'x',
'hello-there',
'new\nline',
'tab\t']],
399 [
'double', [0.0, math.pi, -math.pi, 3.4028235e+38, -3.4028235e+38]],
401 [
'datetime', [datetime.datetime(2005, 12, 6, 12, 13, 14), datetime.datetime(1492, 12, 6, 12, 13, 14)]],
402 [
'base64', [Binary(b
''), Binary(b
'\0'), Binary(str_of_bytes)]],
403 [
'array', [[], [1, 2, 3], [
'a',
'b',
'c'], [0.0, 0.1, 0.2, 2.0, 2.1, -4.0],
404 [1,
'a',
True], [[1, 2, 3], [
'a',
'b',
'c'], [1.0, 2.1, 3.2]]]
409 print(
"Putting parameters onto the server")
411 contexts = [
'',
'scope1',
'scope/sub1/sub2']
415 self.
_setParam(ctx, myState, testVals, master)
418 print(
"Deleting all of our parameters")
422 for key
in list(myState.keys()):
424 print(
"deleting [%s], [%s]" % (ctx, key))
425 self.apiSuccess(master.deleteParam(ctx, key))
433 """testEncapsulation: test encapsulation: setting same parameter at different levels""" 438 testContexts = [
'',
'en',
'en/sub1',
'en/sub2',
'en/sub1/sub2']
439 for c
in testContexts:
440 c = make_global_ns(c)
442 testVal = random.randint(-1000000, 100000)
443 callerId = ns_join(c,
"node")
444 trueKey = ns_join(c, testKey)
445 master.setParam(callerId, testKey, testVal)
446 myState[trueKey] = testVal
448 v1 = self.apiSuccess(master.getParam(
'/', trueKey))
449 v2 = self.apiSuccess(master.getParam(callerId, testKey))
450 assert v1 == v2,
"[%s]: %s vs. [%s,%s]: %s"%(trueKey, v1, callerId, testKey, v2)
451 assert self.apiSuccess(master.hasParam(callerId, testKey)), testKey
452 assert self.apiSuccess(master.hasParam(
'node', trueKey)), trueKey
461 testContexts = [
'',
'sub1',
'sub1/sub2',
'sub1/sub2/sub3']
462 for c
in testContexts:
463 c = make_global_ns(c)
464 callerId = ns_join(c,
"node")
467 testKey =
"~%s"%keyStub
468 testVal = random.randint(-1000000, 100000)
469 master.setParam(callerId, testKey, testVal)
470 trueKey = ns_join(callerId, keyStub)
471 myState[trueKey] = testVal
473 print(
"checking", trueKey)
474 v1 = self.apiSuccess(master.getParam(
'/', trueKey))
475 v2 = self.apiSuccess(master.getParam(callerId, testKey))
476 assert v1 == v2,
"[%s]: %s vs. [%s,%s]: %s"%(trueKey, v1, callerId, testKey, v2)
477 assert self.apiSuccess(master.hasParam(callerId, testKey)), testKey
478 assert self.apiSuccess(master.hasParam(
'node', trueKey)), trueKey
481 testKey = ns_join(
"altnode",
"param2")
482 testVal = random.randint(-1000000, 100000)
483 master.setParam(callerId, testKey, testVal)
484 trueKey = ns_join(c, testKey)
485 altCallerId = ns_join(c,
"altnode")
486 myState[trueKey] = testVal
488 v1 = self.apiSuccess(master.getParam(altCallerId,
"~param2"))
489 v2 = self.apiSuccess(master.getParam(callerId, testKey))
491 assert self.apiSuccess(master.hasParam(callerId, testKey)), testKey
492 assert self.apiSuccess(master.hasParam(altCallerId,
"~param2"))
502 testVal = random.randint(-1000000, 100000)
503 master.setParam(
'/',
'uparam1', testVal)
504 myState[
'/uparam1'] = testVal
505 assert testVal == self.apiSuccess(master.getParam(
'/node',
'uparam1'))
506 assert testVal == self.apiSuccess(master.getParam(
'/uptest/node',
'uparam1'))
507 assert testVal == self.apiSuccess(master.getParam(
'/uptest/sub1/node',
'uparam1'))
508 assert testVal == self.apiSuccess(master.getParam(
'/uptest/sub1/sub2/node',
'uparam1'))
510 testVal = random.randint(-1000000, 100000)
511 master.setParam(
'/uptest2/sub1/node',
'uparam2', testVal)
512 myState[
'/uptest2/sub1/uparam2'] = testVal
513 assert testVal == self.apiSuccess(master.getParam(
'/uptest2/sub1/node',
'uparam2'))
514 assert testVal == self.apiSuccess(master.getParam(
'/uptest2/sub1/sub2/node',
'uparam2'))
515 assert testVal == self.apiSuccess(master.getParam(
'/uptest2/sub1/sub2/sub3/node',
'uparam2'))
519 testVal = random.randint(-1000000, 100000)
520 master.setParam(
'/uptest3/node',
'alt2/alt3/uparam3', testVal)
521 myState[
'/uptest3/alt2/alt3/uparam3'] = testVal
522 assert testVal == self.apiSuccess(master.getParam(
'/uptest3/sub1/node',
'alt2/alt3/uparam3'))
523 assert testVal == self.apiSuccess(master.getParam(
'/uptest3/sub1/sub2/node',
'alt2/alt3/uparam3'))
524 assert testVal == self.apiSuccess(master.getParam(
'/uptest3/sub1/sub2/sub3/node',
'alt2/alt3/uparam3'))
528 self.apiSuccess(master.deleteParam(
'/uptest/sub1/sub2/node',
'uparam1'))
529 del myState[
'/uparam1']
531 self.apiSuccess(master.deleteParam(
'/uptest2/sub1/sub2/sub3/node',
'uparam2'))
532 del myState[
'/uptest2/sub1/uparam2']
534 self.apiSuccess(master.deleteParam(
'/uptest3/sub1/sub2/sub3/node',
'alt2/alt3/uparam3'))
535 del myState[
'/uptest3/alt2/alt3/uparam3']
545 testVal = random.randint(-1000000, 100000)
546 master.setParam(
'/down/one/two/three/node',
'dparam1', testVal)
547 myState[
'/down/one/two/three/dparam1'] = testVal
548 assert not self.apiSuccess(master.hasParam(
'/down/one/node',
'dparam1'))
549 assert not self.apiSuccess(master.hasParam(
'/down/one/two/node',
'dparam1'))
550 self.apiError(master.getParam(
'/down/one/node',
'dparam1'))
551 self.apiError(master.getParam(
'/down/one/two/node',
'dparam1'))
554 testVal = random.randint(-1000000, 100000)
555 master.setParam(
'/',
'/down2/dparam2', testVal)
556 myState[
'/down2/dparam2'] = testVal
557 assert testVal == self.apiSuccess(master.getParam(
'/down2/node',
'dparam2'))
558 assert testVal == self.apiSuccess(master.getParam(
'/',
'down2/dparam2'))
559 assert not self.apiSuccess(master.hasParam(
'/down2/node',
'down2/dparam2'))
560 self.apiError(master.getParam(
'/down2/node',
'down2/dparam2'))
564 testVal = random.randint(-1000000, 100000)
565 master.setParam(
'/',
'/down3/sub/dparam3', testVal)
566 myState[
'/down3/sub/dparam3'] = testVal
567 assert testVal == self.apiSuccess(master.getParam(
'/down3/sub/node',
'dparam3'))
568 assert testVal == self.apiSuccess(master.getParam(
'/down3/node',
'sub/dparam3'))
569 assert testVal == self.apiSuccess(master.getParam(
'/',
'down3/sub/dparam3'))
570 assert testVal == self.apiSuccess(master.getParam(
'/down3/sub/sub2/node',
'dparam3'))
571 assert not self.apiSuccess(master.hasParam(
'/down3/sub/node',
'sub/dparam3'))
572 assert not self.apiSuccess(master.hasParam(
'/down3/sub/node',
'down3/sub/dparam3'))
573 self.apiError(master.getParam(
'/down3/sub/node',
'sub/dparam3'))
574 self.apiError(master.getParam(
'/down3/sub/node',
'down3/sub/dparam3'))
578 master.setParam(
'/',
'/down4/sub/dparam4A', testVal)
579 self.apiSuccess(master.deleteParam(
'/down4/sub/node',
'dparam4A'))
580 assert not self.apiSuccess(master.hasParam(
'/down4/sub',
'dparam4A'))
581 master.setParam(
'/',
'/down4/sub/dparam4B', testVal)
582 self.apiSuccess(master.deleteParam(
'/down4/node',
'sub/dparam4B'))
583 assert not self.apiSuccess(master.hasParam(
'/down4/sub',
'dparam4B'))
584 master.setParam(
'/',
'/down4/sub/dparam4C', testVal)
585 self.apiSuccess(master.deleteParam(
'/',
'down4/sub/dparam4C'))
586 assert not self.apiSuccess(master.hasParam(
'/down4/sub/node',
'dparam4C'))
def _filterDict(self, d)
remove common keys that roslaunch places on param server
def _checkParamState(self, myState)
def _testScopeUp(self)
testScopeUp: test that parameter server can chain up scopes to find/delete parameters ...
def _testScopeDown(self)
testScopeDown: test scoping rules for sub contexts
Parameter Server API Test Cases.
def _testParamValues(self)
def _setParam(self, ctx, myState, testVals, master)
def _testPrivateNames(self)
def _testSearchParam(self)
def _testEncapsulation(self)