Пример #1
0
def test_post_split_function_with_LOCALE_and_GROUPLETTERS_returns_fast_int_and_groupletters_and_locale_convert(x):
    assume(x)
    try:
        assert _post_split_function(ns.GROUPLETTERS | ns.LOCALE)(x) == fast_int(x, key=lambda x: get_strxfrm()(_groupletters(x)))
    except ValueError as e:  # handle broken locale lib on BSD.
        if 'is not in range' not in str(e):
            raise
Пример #2
0
def test_string_component_transform_factory_with_LOCALE_and_DUMB_returns_fast_int_and_groupletters_and_locale_convert(
        x):
    try:
        assert _string_component_transform_factory(ns._DUMB | ns.LOCALE)(
            x) == fast_int(x, key=lambda x: get_strxfrm()(_groupletters(x)))
    except ValueError as e:  # handle broken locale lib on BSD.
        if 'is not in range' not in str(e):
            raise
Пример #3
0
def test_string_component_transform_factory_with_LOCALE_and_DUMB_returns_fast_int_and_groupletters_and_locale_convert_example(
):
    x = 'hello'
    assert _string_component_transform_factory(ns._DUMB
                                               | ns.LOCALE)(x) == fast_int(
                                                   x,
                                                   key=lambda x: get_strxfrm()
                                                   (_groupletters(x)))
Пример #4
0
def test_string_component_transform_factory_with_LOCALE_returns_fast_int_and_groupletters(
        x):
    assert _string_component_transform_factory(ns.LOCALE)(x) == fast_int(
        x, key=get_strxfrm())
Пример #5
0
def test_string_component_transform_factory_with_GROUPLETTERS_returns_fast_int_and_groupletters(
        x):
    assert _string_component_transform_factory(ns.GROUPLETTERS)(x) == fast_int(
        x, key=_groupletters)
Пример #6
0
def test_string_component_transform_factory_returns_fast_int(x):
    assert _string_component_transform_factory(0)(py23_str(x)) == fast_int(
        py23_str(x))
Пример #7
0
def test_string_component_transform_factory_returns_fast_int_example():
    x = 'hello'
    assert _string_component_transform_factory(0)(x) is fast_int(x)
    assert _string_component_transform_factory(0)('5007') == fast_int('5007')
def test_string_component_transform_factory_with_LOCALE_returns_fast_int_and_groupletters(
        x):
    assume(x)
    assume(not any(y in bad_uni_chars for y in x))
    assert _string_component_transform_factory(ns.LOCALE)(x) == fast_int(
        x, key=get_strxfrm())
Пример #9
0
def test_post_split_function_with_LOCALE_returns_fast_int_and_groupletters(x):
    assume(x)
    assume(not any(y in bad_uni_chars for y in x))
    assert _post_split_function(ns.LOCALE)(x) == fast_int(x, key=get_strxfrm())
Пример #10
0
def test_post_split_function_with_LOCALE_and_GROUPLETTERS_returns_fast_int_and_groupletters_and_locale_convert_example():
    x = 'hello'
    assert _post_split_function(ns.GROUPLETTERS | ns.LOCALE)(x) == fast_int(x, key=lambda x: get_strxfrm()(_groupletters(x)))
Пример #11
0
def test_post_split_function_with_LOCALE_returns_fast_int_and_groupletters_example():
    x = 'hello'
    assert _post_split_function(ns.LOCALE)(x) == fast_int(x, key=get_strxfrm())
Пример #12
0
def test_post_split_function_with_GROUPLETTERS_returns_fast_int_and_groupletters(x):
    assume(x)
    assert _post_split_function(ns.GROUPLETTERS)(x) == fast_int(x, key=_groupletters)
Пример #13
0
def test_post_split_function_with_GROUPLETTERS_returns_fast_int_and_groupletters_example():
    x = 'hello'
    assert _post_split_function(ns.GROUPLETTERS)(x) == fast_int(x, key=_groupletters)
Пример #14
0
def test_post_split_function_returns_fast_int(x):
    assume(x)
    assert _post_split_function(0)(py23_str(x)) == fast_int(py23_str(x))
Пример #15
0
def test_post_split_function_returns_fast_int_example():
    x = 'hello'
    assert _post_split_function(0)(x) is fast_int(x)
    assert _post_split_function(0)('5007') == fast_int('5007')