コード例 #1
0
        'on_exception': 5
    }, TypeError),
])
def test_retry_invalid_args(case, exception):
    with pytest.raises(exception):
        _.retry(**case)


@parametrize('case,expected', [(_.times(2, _.stub_list), [[], []]),
                               (_.stub_list(), [])])
def test_stub_list(case, expected):
    assert case == expected


@parametrize('case,expected', [(_.times(2, _.stub_dict), [{}, {}]),
                               (_.stub_dict(), {})])
def test_stub_dict(case, expected):
    assert case == expected


@parametrize('case,expected', [(_.times(2, _.stub_false), [False, False]),
                               (_.stub_false(), False)])
def test_stub_false(case, expected):
    assert case == expected


@parametrize('case,expected', [(_.times(2, _.stub_string), ['', '']),
                               (_.stub_string(), '')])
def test_stub_string(case, expected):
    assert case == expected
コード例 #2
0
ファイル: test_utilities.py プロジェクト: dgilland/pydash
def test_retry_invalid_args(case, exception):
    with pytest.raises(exception):
        _.retry(**case)


@parametrize('case,expected', [
    (_.times(2, _.stub_list), [[], []]),
    (_.stub_list(), [])
])
def test_stub_list(case, expected):
    assert case == expected


@parametrize('case,expected', [
    (_.times(2, _.stub_dict), [{}, {}]),
    (_.stub_dict(), {})
])
def test_stub_dict(case, expected):
    assert case == expected


@parametrize('case,expected', [
    (_.times(2, _.stub_false), [False, False]),
    (_.stub_false(), False)
])
def test_stub_false(case, expected):
    assert case == expected


@parametrize('case,expected', [
    (_.times(2, _.stub_string), ['', '']),