@@ -581,10 +581,10 @@ def test_listen_clear_last(self, mock_mqtt):
581
581
'''Test listen command: clear last message'''
582
582
mock_client = Mock ()
583
583
mock_mqtt .return_value = mock_client
584
- self .fb .state .last_message = "message"
584
+ self .fb .state .last_messages = { '#' : "message" }
585
585
self .fb .state .test_env = False
586
586
self .fb .listen (1 )
587
- self .assertIsNone (self .fb .state .last_message )
587
+ self .assertIsNone (self .fb .state .last_messages [ '#' ] )
588
588
589
589
@patch ('requests.request' )
590
590
@patch ('paho.mqtt.client.Client' )
@@ -1074,7 +1074,7 @@ def exec_command():
1074
1074
def test_get_xyz (self ):
1075
1075
'''Test get_xyz command'''
1076
1076
def exec_command ():
1077
- self .fb .state .last_message = {
1077
+ self .fb .state .last_messages [ 'status' ] = {
1078
1078
'location_data' : {'position' : {'x' : 1 , 'y' : 2 , 'z' : 3 }},
1079
1079
}
1080
1080
position = self .fb .get_xyz ()
@@ -1091,7 +1091,7 @@ def exec_command():
1091
1091
def test_get_xyz_no_status (self ):
1092
1092
'''Test get_xyz command: no status'''
1093
1093
def exec_command ():
1094
- self .fb .state .last_message = None
1094
+ self .fb .state .last_messages [ 'status' ] = None
1095
1095
position = self .fb .get_xyz ()
1096
1096
self .assertIsNone (position )
1097
1097
self .send_command_test_helper (
@@ -1106,7 +1106,7 @@ def exec_command():
1106
1106
def test_check_position (self ):
1107
1107
'''Test check_position command: at position'''
1108
1108
def exec_command ():
1109
- self .fb .state .last_message = {
1109
+ self .fb .state .last_messages [ 'status' ] = {
1110
1110
'location_data' : {'position' : {'x' : 1 , 'y' : 2 , 'z' : 3 }},
1111
1111
}
1112
1112
at_position = self .fb .check_position (1 , 2 , 3 , 0 )
@@ -1123,7 +1123,7 @@ def exec_command():
1123
1123
def test_check_position_false (self ):
1124
1124
'''Test check_position command: not at position'''
1125
1125
def exec_command ():
1126
- self .fb .state .last_message = {
1126
+ self .fb .state .last_messages [ 'status' ] = {
1127
1127
'location_data' : {'position' : {'x' : 1 , 'y' : 2 , 'z' : 3 }},
1128
1128
}
1129
1129
at_position = self .fb .check_position (0 , 0 , 0 , 2 )
@@ -1140,7 +1140,7 @@ def exec_command():
1140
1140
def test_check_position_no_status (self ):
1141
1141
'''Test check_position command: no status'''
1142
1142
def exec_command ():
1143
- self .fb .state .last_message = None
1143
+ self .fb .state .last_messages [ 'status' ] = None
1144
1144
at_position = self .fb .check_position (0 , 0 , 0 , 2 )
1145
1145
self .assertFalse (at_position )
1146
1146
self .send_command_test_helper (
@@ -1344,7 +1344,7 @@ def test_get_seed_tray_cell_invalid_pullout_direction(self):
1344
1344
def test_get_job_one (self ):
1345
1345
'''Test get_job command: get one job'''
1346
1346
def exec_command ():
1347
- self .fb .state .last_message = {
1347
+ self .fb .state .last_messages [ 'status' ] = {
1348
1348
'jobs' : {
1349
1349
'job name' : {'status' : 'working' },
1350
1350
},
@@ -1363,7 +1363,7 @@ def exec_command():
1363
1363
def test_get_job_all (self ):
1364
1364
'''Test get_job command: get all jobs'''
1365
1365
def exec_command ():
1366
- self .fb .state .last_message = {
1366
+ self .fb .state .last_messages [ 'status' ] = {
1367
1367
'jobs' : {
1368
1368
'job name' : {'status' : 'working' },
1369
1369
},
@@ -1382,7 +1382,7 @@ def exec_command():
1382
1382
def test_get_job_no_status (self ):
1383
1383
'''Test get_job command: no status'''
1384
1384
def exec_command ():
1385
- self .fb .state .last_message = None
1385
+ self .fb .state .last_messages [ 'status' ] = None
1386
1386
job = self .fb .get_job ('job name' )
1387
1387
self .assertIsNone (job )
1388
1388
self .send_command_test_helper (
0 commit comments