Lines Matching refs:resp

99 def verify_device_object(resp):  argument
101 assert resp[0][0] == 'Zephyr'
102 assert resp[0][1] == 'client-1'
103 assert resp[0][2] == 'serial-1'
104 assert resp[0][3] == '1.2.3'
105 assert resp[0][11][0] == 0
106 assert resp[0][16] == 'U'
122 resp = leshan.read(endpoint,'3/0')
123 verify_device_object(resp)
130 resp = leshan.read(endpoint, '3/0')
131 verify_device_object(resp)
194 resp = leshan.read(endpoint, '1/0')
195 assert resp[0][2] == 101
196 assert resp[0][3] == 1010
197 assert resp[0][5] == 2000
198 assert resp[0][6] is True
199 assert resp[0][7] == 'U'
221 resp = leshan.read(endpoint, '1')
222 assert len(resp) == 1
223 assert len(resp[1][0]) == 11
224 resp = leshan.read(endpoint, '3')
225 assert len(resp) == 1
226 assert len(resp[3]) == 1
227 assert len(resp[3][0]) == 15
228 assert resp[3][0][0] == 'Zephyr'
232 resp = leshan.read(endpoint, '1/0')
233 assert len(resp[0]) == 11
234 resp = leshan.read(endpoint, '3/0')
235 assert len(resp[0]) == 15
236 assert resp[0][0] == 'Zephyr'
292 resp = leshan.composite_read(endpoint, ['/3', '1/0'])
293 assert len(resp.keys()) == 2
294 assert resp[3] is not None
295 assert resp[1][0] is not None
296 assert len(resp[3][0]) == 15
297 assert len(resp[1][0]) == 11
299 resp = leshan.composite_read(endpoint, ['1/0/1', '/3/0/11/0'])
300 logger.debug(resp)
301 assert len(resp.keys()) == 2
302 assert resp[1][0][1] is not None
303 assert resp[3][0][11][0] is not None
322 resp = leshan.read(endpoint, '1/0')
323 assert resp[0][1] == 60
324 assert resp[0][6] is True
325 resp = leshan.read(endpoint, '16/0/0')
326 assert resp[0][0] == "aa"
327 assert resp[0][1] == "bb"
328 assert resp[0][2] == "cc"
329 assert resp[0][3] == "dd"
384 resp = leshan.composite_read(endpoint, ['/'])
386 missing_keys = [key for key in expected_keys if key not in resp.keys()]
391 resp = leshan.composite_read(endpoint, ['1/0', '/3/0/11/0', '/3339/0/5522', '/3353/0/6030'])
392 assert resp[1][0][1] is not None
393 assert resp[3][0][11][0] is not None
394 assert len(resp) == 2
443 resp = leshan.discover(endpoint, '3')
445 missing_keys = [key for key in expected_keys if key not in resp.keys()]
448 resp = leshan.discover(endpoint, '3/0')
449 assert int(resp['/3/0/6']['dim']) == 2
450 assert int(resp['/3/0/7']['dim']) == 2
451 assert int(resp['/3/0/8']['dim']) == 2
453 resp = leshan.discover(endpoint, '3/0')
455 missing_keys = [key for key in expected_keys if key not in resp.keys()]
457 assert int(resp['/3/0/7']['dim']) == 2
458 assert float(resp['/3/0/7']['lt']) == 1.0
459 assert float(resp['/3/0/7']['gt']) == 6.0
460 assert float(resp['/3/0/7']['st']) == 1.0
461 resp = leshan.discover(endpoint, '3/0/7')
463 missing_keys = [key for key in expected_keys if key not in resp.keys()]
465 assert len(resp) == len(expected_keys)
471 resp = leshan.discover(endpoint, '3/0/11')
472 logger.debug(resp)
474 missing_keys = [key for key in expected_keys if key not in resp.keys()]
476 assert len(resp) == len(expected_keys)
477 assert int(resp['/3/0/11']['dim']) == 1
481 resp = leshan.discover(endpoint, '3/0/11')
482 logger.debug(resp)
483 assert int(resp['/3/0/11']['pmin']) == 10
484 assert int(resp['/3/0/11']['pmax']) == 320
485 assert int(resp['/3/0/11/0']['pmax']) == 100
495 resp = leshan.composite_read(endpoint, ['/3/0/16', '/3/0/11/0', '/1/0'])
496 logger.debug(resp)
497 assert len(resp) == 2
498 assert len(resp[3]) == 1
499 assert len(resp[3][0]) == 2 # No extra resources
500 assert resp[3][0][11][0] == 0
501 assert resp[3][0][16] == 'U'
502 assert resp[1][0][0] == 1
503 assert resp[1][0][1] == 86400
504 assert resp[1][0][6] is False
505 assert resp[1][0][7] == 'U'
509 resp = leshan.composite_read(endpoint, ['/1/0/1', '/1/0/7', '/1/0/8'])
510 assert len(resp) == 1
511 assert len(resp[1][0]) == 2 # /1/0/8 should not be there
512 assert resp[1][0][1] == 86400
513 assert resp[1][0][7] == 'U'