def test_one_of():
    assert hug.types.one_of(('bacon', 'sausage', 'pancakes'))('bacon') == 'bacon'
    assert hug.types.one_of(['bacon', 'sausage', 'pancakes'])('sausage') == 'sausage'
    assert hug.types.one_of({'bacon', 'sausage', 'pancakes'})('pancakes') == 'pancakes'
    assert 'bacon' in hug.types.one_of({'bacon', 'sausage', 'pancakes'}).__doc__
    with pytest.raises(KeyError):
        hug.types.one_of({'bacon', 'sausage', 'pancakes'})('syrup')
Tests that hug allows limiting a value to one of a list of values
dataset/ETHPy150Open timothycrosley/hug/tests/test_types.py/test_one_of