Example #1
0
def test_get_arguments_keyword_with_context():
    args = get_arguments({"foo": "bar"}, context="baz")
    assert args == (["baz"], {"foo": "bar"})
Example #2
0
def test_get_arguments_invalid_string():
    with pytest.raises(AssertionError):
        get_arguments("str")
Example #3
0
def test_get_arguments_positional_with_context():
    args = get_arguments(["foo"], context="bar")
    assert args == (["bar", "foo"], {})
Example #4
0
def test_get_arguments_keyword():
    assert get_arguments({"foo": "bar"}) == ([], {"foo": "bar"})
Example #5
0
def test_get_arguments_positional():
    assert get_arguments([2, 3]) == ([2, 3], {})
Example #6
0
def test_get_arguments_invalid():
    with pytest.raises(AssertionError):
        assert get_arguments(5)
Example #7
0
def test_get_arguments_none():
    with pytest.raises(AssertionError):
        get_arguments(None)
Example #8
0
def test_get_arguments_no_params_with_context():
    args = get_arguments(context="bar")
    assert args == (["bar"], {})