コード例 #1
0
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"
コード例 #2
0
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"
コード例 #3
0
def test_get_response_invalid_message():
    data = "adasdbfsdwerasinvalid,sdfds;"
    result = gps103.get_response(data)
    assert result["message"] is False
    assert result["type"] == "invalid"
コード例 #4
0
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"
コード例 #5
0
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"
コード例 #6
0
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"
コード例 #7
0
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"
コード例 #8
0
def test_get_response_heartbeat_pattern():
    data = "359586015829802;"
    result = gps103.get_response(data)
    assert result["message"] == b'ON'
    assert result["type"] == "heartbeat"
コード例 #9
0
def test_get_response_login_pattern():
    data = "##,imei:359586015829802,A;"
    result = gps103.get_response(data)
    assert result["message"] == b'LOAD'
    assert result["type"] == "login"
コード例 #10
0
def test_get_response_invalid_message():
    data = "adasdbfsdwerasinvalid,sdfds;"
    result = gps103.get_response(data)
    assert result["message"] is False
    assert result["type"] == "invalid"
コード例 #11
0
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"
コード例 #12
0
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"
コード例 #13
0
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"
コード例 #14
0
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"
コード例 #15
0
def test_get_response_heartbeat_pattern():
    data = "359586015829802;"
    result = gps103.get_response(data)
    assert result["message"] == b'ON'
    assert result["type"] == "heartbeat"
コード例 #16
0
def test_get_response_login_pattern():
    data = "##,imei:359586015829802,A;"
    result = gps103.get_response(data)
    assert result["message"] == b'LOAD'
    assert result["type"] == "login"