Exemple #1
0
def test_radius():
    assert OPTIONS['radius'] == 6370997.0
    with set_options(radius=5.):
        assert OPTIONS['radius'] == 5.
    with pytest.raises(ValueError):
        with set_options(radius='a'):
            pass
Exemple #2
0
def test_invalid_option_raises():
    with pytest.raises(ValueError):
        set_options(not_a_valid_options=True)
Exemple #3
0
def test_time_dim():
    assert OPTIONS['time_dim'] == 'time'
    with set_options(time_dim='t'):
        assert OPTIONS['time_dim'] == 't'
Exemple #4
0
def test_phalf_dim():
    assert OPTIONS['phalf_dim'] == 'phalf'
    with set_options(phalf_dim='ph'):
        assert OPTIONS['phalf_dim'] == 'ph'
Exemple #5
0
def test_pfull_dim():
    assert OPTIONS['pfull_dim'] == 'pfull'
    with set_options(pfull_dim='pf'):
        assert OPTIONS['pfull_dim'] == 'pf'
Exemple #6
0
def test_lat_dim():
    assert OPTIONS['lat_dim'] == 'lat'
    with set_options(lat_dim='latitude'):
        assert OPTIONS['lat_dim'] == 'latitude'
Exemple #7
0
def test_lon_dim():
    assert OPTIONS['lon_dim'] == 'lon'
    with set_options(lon_dim='longitude'):
        assert OPTIONS['lon_dim'] == 'longitude'