Ejemplo n.º 1
0
def test_check_required_arguments_missing_multiple(arguments_terms_multiple):
    params = {
        'apples': 'woohoo',
    }
    expected = "missing required arguments: bar, foo"

    with pytest.raises(TypeError) as e:
        check_required_arguments(arguments_terms_multiple, params)

    assert to_native(e.value) == expected
Ejemplo n.º 2
0
def test_check_required_arguments_missing_none():
    terms = None
    params = {
        'foo': 'bar',
        'baz': 'buzz',
    }
    assert check_required_arguments(terms, params) == []
Ejemplo n.º 3
0
def test_check_required_arguments_no_params(arguments_terms):
    with pytest.raises(TypeError) as te:
        check_required_arguments(arguments_terms, None)
    assert "'NoneType' is not iterable" in to_native(te.value)
Ejemplo n.º 4
0
def test_check_required_arguments(arguments_terms):
    params = {
        'foo': 'hello',
        'bar': 'haha',
    }
    assert check_required_arguments(arguments_terms, params) == []