def test_get_response_tyre_data_pattern(): data = "imei:359710049100168,TPMS,160712171718,12,23,45,67,45,78,54,876,34,56,34,234,656,76,88;" result = gps103.get_response(data) print(result) assert result["message"] is False assert result["type"] == "data" assert result["sub_type"] == "tyre"
def test_get_response_invalid_message(): data = "adasdbfsdwerasinvalid,sdfds;" result = gps103.get_response(data) assert result["message"] is False assert result["type"] == "invalid"
def test_get_response_obd_data_pattern(): data = "imei:359710049100168,OBD,160712171718,12,23,45,67,45,78,54,876,34,56,34,234,656,76,34,54;" result = gps103.get_response(data) assert result["message"] is False assert result["type"] == "data" assert result["sub_type"] == "obd"
def test_get_response_gps_data_pattern_speed(): data = "imei:359710049100168,speed,160712171718,,F,051718.000,A,4339.3792,S,17230.8680,E,49.28,129.72,,1,0,,,;" result = gps103.get_response(data) assert result["message"] is False assert result["type"] == "data" assert result["sub_type"] == "gps"
def test_get_response_gps_data_pattern_acc_alarm(): data = "imei:359710049100168,acc alarm,160712171651,,F,051651.000,A,4339.0694,S,17230.5769,E,52.68,158.86,,1,0,,,;" result = gps103.get_response(data) assert result["message"] is False assert result["type"] == "data" assert result["sub_type"] == "gps"
def test_get_response_gps_data_pattern_move(): data = "imei:359710049100168,move,160712015143,,F,135145.000,A,4339.8602,S,17232.8935,E,0.30,339.24,,0,0,,,;" result = gps103.get_response(data) assert result["message"] is False assert result["type"] == "data" assert result["sub_type"] == "gps"
def test_get_response_heartbeat_pattern(): data = "359586015829802;" result = gps103.get_response(data) assert result["message"] == b'ON' assert result["type"] == "heartbeat"
def test_get_response_login_pattern(): data = "##,imei:359586015829802,A;" result = gps103.get_response(data) assert result["message"] == b'LOAD' assert result["type"] == "login"