Example #1
0
def test_kwargs_to_list_4():
    keys = kwargs_to_list({
        'int': 1,
        'boolean': True,
        'str': 'abc',
        'list': [1, '2']
    })
    assert keys == ["boolean-True", "int-1", "list-[1, '2']", "str-abc"]
Example #2
0
def test_kwargs_to_list_5():
    keys = kwargs_to_list(
        {'a': {u'é': 'c'}, 'b': [u'a', 'é'], u'c': 1, 'd': 'é', 'e': u'é'})
    assert keys == [
        "a-{'\\xc3\\xa9': 'c'}",
        "b-['a', '\\xc3\\xa9']",
        "c-1",
        "d-\xc3\xa9",
        "e-\xc3\xa9",
    ]
Example #3
0
def test_kwargs_to_list_6():
    keys = kwargs_to_list({
        'a': {
            u'é': 'c'
        },
        'b': [u'a', 'é'],
        u'c': 1,
        'd': 'é',
        'e': u'é'
    })
    assert keys == ["a-{'é': 'c'}", "b-['a', 'é']", "c-1", "d-é", 'e-é']
Example #4
0
def test_kwargs_to_list_nested_dict_is_sorted_2():
    keys = kwargs_to_list(
        {'nested': {
            'a': {
                'a': 1,
                'b': 2
            },
            'c': 2,
            'b': 3,
            'd': 4,
            'e': 5
        }})
    assert keys == [
        "nested-{'a': \"{'a': 1, 'b': 2}\", 'b': 3, 'c': 2, 'd': 4, 'e': 5}"
    ]
Example #5
0
def test_kwargs_to_list_5():
    keys = kwargs_to_list({
        'a': {
            u'é': 'c'
        },
        'b': [u'a', 'é'],
        u'c': 1,
        'd': 'é',
        'e': u'é'
    })
    assert keys == [
        "a-{'\\xc3\\xa9': 'c'}",
        "b-['a', '\\xc3\\xa9']",
        "c-1",
        "d-\xc3\xa9",
        "e-\xc3\xa9",
    ]
Example #6
0
def test_kwargs_to_list_3():
    keys = kwargs_to_list({'int': 1, 'boolean': True, 'str': "abc"})
    assert keys == ["boolean-True", "int-1", "str-abc"]
Example #7
0
def test_kwargs_to_list_2():
    keys = kwargs_to_list({'int': 1, 'boolean': True})
    assert keys == ["boolean-True", "int-1"]
Example #8
0
def test_kwargs_to_list_1():
    keys = kwargs_to_list({'int': 1})
    assert keys == ["int-1"]
Example #9
0
def test_kwargs_to_list_empty():
    keys = kwargs_to_list({})
    assert keys == []
Example #10
0
def test_kwargs_to_list_6():
    keys = kwargs_to_list(
        {'a': {u'é': 'c'}, 'b': [u'a', 'é'], u'c': 1, 'd': 'é', 'e': u'é'})
    assert keys == ["a-{'é': 'c'}", "b-['a', 'é']", "c-1", "d-é", 'e-é']
Example #11
0
def test_kwargs_to_list_4():
    keys = kwargs_to_list(
        {'int': 1, 'boolean': True, 'str': 'abc', 'list': [1, '2']})
    assert keys == ["boolean-True", "int-1", "list-[1, '2']", "str-abc"]
Example #12
0
def test_kwargs_to_list_3():
    keys = kwargs_to_list({'int': 1, 'boolean': True, 'str': "abc"})
    assert keys == ["boolean-True", "int-1", "str-abc"]
Example #13
0
def test_kwargs_to_list_2():
    keys = kwargs_to_list({'int': 1, 'boolean': True})
    assert keys == ["boolean-True", "int-1"]
Example #14
0
def test_kwargs_to_list_1():
    keys = kwargs_to_list({'int': 1})
    assert keys == ["int-1"]
Example #15
0
def test_kwargs_to_list_empty():
    keys = kwargs_to_list({})
    assert keys == []