Skip to content
Snippets Groups Projects
test_grib.py 574 B
Newer Older
Max Drexler's avatar
Max Drexler committed
from grib_processor.grib import xcd_lookup, load_xcd_models


def test_custom_loading():
    """Test that loading a custom xcd model works with xcd_lookup.

    Note: This is a leaky test, the custom model will be in following tests.
    """
    f_lat = 123
    f_lon = 456
    rows = 1
    cols = 5
    g_id = 6
    m_name = "custom_name"
    m_id = "custom_id"
    c_model = {
        str(f_lat): {str(f_lon): {str(rows): {str(cols): {str(g_id): [m_name, m_id]}}}}
    }
    load_xcd_models(c_model)
    assert xcd_lookup(f_lat, f_lon, rows, cols, g_id) == (m_name, m_id)