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