コード例 #1
0
async def test_Vehicle_Controls_Speedlimit_set_speed_limit(client, mocker):
    v = vehi(client, mocker, {"result": True})
    speedlimit = v.controls.speedlimit
    with pytest.raises(ValueError):
        await speedlimit.set_speed_limit(99999)


    with pytest.raises(KeyError):
        v._data.pop("gui_settings")
        await speedlimit.set_speed_limit(90)
コード例 #2
0
async def test_Vehicle_Status_refresh(client, mocker):
    v = vehi(client, mocker, DRIVE_STATE)
    r = await v.status.refresh()
    assert isinstance(r, dict)
コード例 #3
0
async def test_Vehicle_Controls_Speedlimit_activate_speed_limit(client, mocker):
    v = vehi(client, mocker, {"result": True})
    speedlimit = v.controls.speedlimit
    assert await speedlimit.activate_speed_limit(9999) is True
コード例 #4
0
async def test_Vehicle_Controls_Software_update(client, mocker):
    v = vehi(client, mocker, {"result": True})
    software = v.controls.software
    assert await software.update(datetime.now())
    assert await software.update(99999)
コード例 #5
0
async def test_Vehicle_Controls_Software_cancel_update(client, mocker):
    v = vehi(client, mocker, {"result": True})
    software = v.controls.software
    assert await software.cancel_update()
コード例 #6
0
async def test_Vehicle_Charge_refresh(client, mocker):
    v = vehi(client, mocker, CHARGE_STATE)
    charge = v.charge

    data = await charge.refresh()
    assert isinstance(data, dict)
コード例 #7
0
ファイル: test_climate.py プロジェクト: Hellowlol/tesla_api
async def test_Vehicle_refresh(client, mocker):
    v = vehi(client, mocker, CLIMATE_STATE)
    data = await v.climate.refresh()
    assert data == CLIMATE_STATE
コード例 #8
0
async def test_Vehicle_get_state(client, mocker):
    v = vehi(client, mocker, VEHICLE_STATE)
    r = await v.get_state()
    assert isinstance(r, dict)
コード例 #9
0
async def test_Vehicle_get_drive_state(client, mocker):
    v = vehi(client, mocker, DRIVE_STATE)
    r = await v.get_data()
    assert r == DRIVE_STATE
コード例 #10
0
async def test_Vehicle_get_data(client, mocker):
    v = vehi(client, mocker, CHARGE_STATE)
    r = await v.get_data()
    assert r == CHARGE_STATE
コード例 #11
0
async def test_Vehicle_full_update(client, mocker):
    v = vehi(client, mocker, FULL_DATA)
    r = await v.get_data()
    assert r == FULL_DATA
コード例 #12
0
async def test_Vehicle_is_mobile_access_enabled(client, mocker):
    v = vehi(client, mocker, True)
    result = await v.is_mobile_access_enabled()
    assert result is True
コード例 #13
0
async def test_Vehicle_get_climate_state(client, mocker):
    v = vehi(client, mocker, CLIMATE_STATE)
    r = await v.get_climate_state()
    assert r == CLIMATE_STATE
コード例 #14
0
async def test_Vehicle_get_charge_state(client, mocker):
    v = vehi(client, mocker, CHARGE_STATE)
    r = await v.get_charge_state()
    assert r == CHARGE_STATE
コード例 #15
0
async def test_Vehicle_refresh(client, mocker):
    v = vehi(client, mocker, ATTRS)
    r = await v.refresh()
    assert r == ATTRS
コード例 #16
0
async def test_Vehicle_get_gui_settings(client, mocker):
    v = vehi(client, mocker, GUI_SETTINGS)
    r = await v.get_data()
    assert r == GUI_SETTINGS