def test_longitude():
    schema = vol.Schema(cv.longitude)

    for value in ('invalid', None, -181, 181, '-181', '181', '123.01A'):
        with pytest.raises(vol.MultipleInvalid):
            schema(value)

    for value in ('-179', 179, '12.34'):
        schema(value)
Test longitude validation.
dataset/ETHPy150Open home-assistant/home-assistant/tests/helpers/test_config_validation.py/test_longitude