@pytest.mark.parametrize('data,should_raise', [([['foo', 'bar'], ['foo', 'baz']], False), ([('foo', 'bar'), ('foo', 'baz')], False), ((['foo', 'bar'], ['foo', 'baz']), False), ([['foo', 'bar'], ['foo', 'baz', 'bax']], True), ({'foo': ['bar', 'baz']}, False), ({'foo': ('bar', 'baz')}, False), ({'foo': 'bar'}, True)])
def test_multi_params(data, should_raise):
    if should_raise:
        with pytest.raises(AssertionError):
            utils.MultiParams(data)
        return
    p1 = utils.MultiParams(data)
    assert ('bar' == p1['foo'])
    assert (['bar', 'baz'] == list(p1.getlist('foo')))
@pytest.mark.parametrize('data,should_raise', [([['foo', 'bar'], ['foo', 'baz']], False), ([('foo', 'bar'), ('foo', 'baz')], False), ((['foo', 'bar'], ['foo', 'baz']), False), ([['foo', 'bar'], ['foo', 'baz', 'bax']], True), ({'foo': ['bar', 'baz']}, False), ({'foo': ('bar', 'baz')}, False), ({'foo': 'bar'}, True)])
def test_multi_params(data, should_raise):
    if should_raise:
        with pytest.raises(AssertionError):
            utils.MultiParams(data)
        return
    p1 = utils.MultiParams(data)
    assert ('bar' == p1['foo'])
    assert (['bar', 'baz'] == list(p1.getlist('foo')))