async def test_webhook_update_location(hass, webhook_client, create_registrations):
    'Test that location can be updated.'
    resp = (await webhook_client.post('/api/webhook/{}'.format(create_registrations[1]['webhook_id']), json={'type': 'update_location', 'data': {'gps': [1, 2], 'gps_accuracy': 10, 'altitude': (- 10)}}))
    assert (resp.status == 200)
    state = hass.states.get('device_tracker.test_1_2')
    assert (state is not None)
    assert (state.attributes['latitude'] == 1.0)
    assert (state.attributes['longitude'] == 2.0)
    assert (state.attributes['gps_accuracy'] == 10)
    assert (state.attributes['altitude'] == (- 10))
Test that location can be updated.
async def test_webhook_update_location(hass, webhook_client, create_registrations):
    
    resp = (await webhook_client.post('/api/webhook/{}'.format(create_registrations[1]['webhook_id']), json={'type': 'update_location', 'data': {'gps': [1, 2], 'gps_accuracy': 10, 'altitude': (- 10)}}))
    assert (resp.status == 200)
    state = hass.states.get('device_tracker.test_1_2')
    assert (state is not None)
    assert (state.attributes['latitude'] == 1.0)
    assert (state.attributes['longitude'] == 2.0)
    assert (state.attributes['gps_accuracy'] == 10)
    assert (state.attributes['altitude'] == (- 10))