1 from mqtt_bridge.bridge
import RosToMqttBridge
2 from mqtt_bridge.util
import extract_values, populate_instance, lookup_object
3 from sensor_msgs.msg
import Temperature
4 from std_msgs.msg
import Header, String, Bool
9 assert obj == RosToMqttBridge
18 expected = {
'header': {
'stamp': {
'secs': 0,
'nsecs': 0},
'frame_id':
'',
'seq': 0},
'temperature': 25.2,
'variance': 0.0}
19 actual = extract_values(msg)
20 assert expected == actual
25 expected = {
'data':
'hello'}
26 actual = extract_values(msg)
27 assert expected == actual
31 msg_dict = {
'header': {
'stamp': {
'secs': 0,
'nsecs': 0},
'frame_id':
'',
'seq': 0},
'temperature': 25.2,
'variance': 0.0}
33 populate_instance(msg_dict, msg)
34 assert msg.temperature == 25.2
35 assert msg.variance == 0.0
39 msg_dict = {
'data':
True}
41 populate_instance(msg_dict, msg)
42 assert msg.data ==
True def test_extract_values_priimtive()
def test_populate_instance_primitive()
def test_extract_values()
def test_populate_instance()