def test_mapping():
    mapping_type = hug.types.mapping({'n': None, 'l': [], 's': set()})
    assert mapping_type('n') is None
    assert mapping_type('l') == []
    assert mapping_type('s') == set()
    assert 'n' in mapping_type.__doc__
    with pytest.raises(KeyError):
        mapping_type('bacon')
Test to ensure the mapping type works as expected
dataset/ETHPy150Open timothycrosley/hug/tests/test_types.py/test_mapping