from layercake.funcs import omit, pick


def test_omit():
    values = {'indigo': '#4b0082', 'navy': '#000080'}
    assert omit(['indigo'], values) == {'navy': '#000080'}
    assert omit(['test'], values) == values


def test_pick():
    values = {'indigo': '#4b0082', 'navy': '#000080'}
    assert pick(['navy'], values) == {'navy': '#000080'}
    assert pick(['test'], values) == {}


def test_pick_default_val():
    values = {'name': 'test'}
    assert pick(['name', 'surname'], values, exclude_none=False, default=False) == {
        'name': 'test',
        'surname': False,
    }
