Пример #1
0
def test_kw_new_order():
    result = kwargs_ex.fun(visited_color='green',
                           for_color='blue',
                           back_color='red',
                           link_color='yellow')

    assert result == ('blue', 'red', 'yellow', 'green')
Пример #2
0
def test_kw():
    '''test'''
    result = kwargs_ex.fun(fore_color='blue',
                           back_color='red',
                           link_color='yellow',
                           visited_color='green')
    assert result == ('blue', 'red', 'yellow', 'green')
Пример #3
0
def test_kw_dict():
    dic = {'fore_color': 'blue',
           'back_color': 'red',
           'link_color': 'yellow',
           'visited_color': 'green'}
    result = kwargs_ex.fun(**dic)
    assert result == ('blue', 'red', 'yellow', 'green')
Пример #4
0
def test_positional():
    result = kwargs_ex.fun( "blue",
                            "red",
                            visited_color="green",
                            link_color="yellow")

    assert result == ("blue", "red", "yellow", "green")
Пример #5
0
def test_combo():
    # fore_color, back_color, link_color, visited_color
    tuple = ( "blue", "red" )
    dic = { "link_color": "yellow",
            "visited_color": "green" }
    result = kwargs_ex.fun( *tuple, **dic )
    assert result == ("blue", "red", "yellow", "green")
Пример #6
0
def test_dict():
    # fore_color, back_color, link_color, visited_color
    dic = { "fore_color": "blue",
            "back_color": "red",
            "link_color": "yellow",
            "visited_color": "green" }
    result = kwargs_ex.fun( ** dic )
    assert result == ("blue", "red", "yellow", "green")
Пример #7
0
def test_kw_new_order():
    result = kwargs_ex.fun(
        'green',
        'blue',
        'purple',
        'red',
    )
    assert result == ('green', 'blue', 'purple', 'red')
Пример #8
0
def test_kw_tuple():
    tup = ('green',
           'blue',
           'purple',
           'red')
    result = kwargs_ex.fun(*tup)
    # assert result == ('green', 'blue', 'yellow', 'green')
    assert result == tup
Пример #9
0
def test_kw_combo():
    result = kwargs_ex.fun(
        'green',
        'blue',
        visited_color='green',
        link_color='yellow',
    )
    assert result == ('green', 'blue', 'yellow', 'green')
Пример #10
0
def test_dict():
    mydict = {
        'link_color': 'white',
        'fore_color': 'purple',
        'visted_color': 'bronze',
        'back_color': 'blue'
    }
    result = kwargs_ex.fun(**mydict)
    assert result == ('purple', 'blue', 'white', 'bronze')
Пример #11
0
def test_kw_new_order_pos():
    result = kwargs_ex.fun(
        'blue',
        'red',
        'yellow',
        'green',
    )

    assert result == ('blue', 'red', 'yellow', 'green')
Пример #12
0
def test_kw_combo():
    tup = ('green', )
    dic = {
        "link_color": 'yellow',
        "visited_color": 'green',
    }
    result = kwargs_ex.fun(*tup, **dic)

    assert result == ('green', 'red', 'yellow', 'green')
Пример #13
0
def test_kw_dict():
    dic = {
        "fore_color": 'blue',
        "back_color": 'red',
        "link_color": 'yellow',
        "visited_color": 'green',
    }
    result = kwargs_ex.fun(**dic)

    assert result == ('blue', 'red', 'yellow', 'green')
Пример #14
0
def test_kw_combo_dic():
    tup = {'blue', 'green'}

    dic = {  #'for_color':'blue',
        #'back_color':'red',
        'link_color': 'purple',
        'visited_color': 'yellow'
    }
    result = kwargs_ex.fun(*tup, **dic)

    assert result == ('blue', 'green', 'purple', 'yellow')
Пример #15
0
def test_kw_combo():
    '''
    Positional argument vs keyword arguments
    '''
    tup = ('green',
           'blue',
           )
    dic = {#'fore_color': 'blue',
           #'back_color': 'red',
           'link_color': 'yellow',
           'visited_color': 'green',
           }
    result = kwargs_ex.fun(*tup, **dic)

    assert result == ('green', 'blue', 'yellow', 'green')
Пример #16
0
def test_tuple():
    tup = ('red', 'blue')
    result = kwargs_ex.fun(*tup, 'yellow1')
    assert result == ('red', 'blue', 'yellow1', 'green')
Пример #17
0
def test_default():
    result = kwargs_ex.fun()

    assert result == ('blue', 'red', 'yellow', 'green')
Пример #18
0
def test_just_keyword_arguments():
    result = kwargs_ex.fun(link_color='red', back_color='blue')
    assert result == ('blue', 'blue', 'red', 'green')
Пример #19
0
def test_kw_combo_bad():
    with pytest.raises(TypeError):
        result = kwargs_ex.fun('green',
                               visited_color='green',
                               no_color='green')
Пример #20
0
def test_kw_new_params():
    '''test'''
    result = kwargs_ex.fun('green', 'blue', 'yellow', 'red')
    assert result == ('blue', 'red', 'yellow', 'green')
Пример #21
0
def test_kw_combo():
    '''test'''
    result = kwargs_ex.fun('blue', 'red', 'yellow', 'red')
    assert result == ('blue', 'red', 'yellow', 'red')
Пример #22
0
def test_basic():
    result = kwargs_ex.fun( "blue",
                            "red",
                            "yellow",
                            "green")
    assert result == ("blue", "red", "yellow", "green")
Пример #23
0
def test_combination_postional_keyword():
    result = kwargs_ex.fun('purple', link_color='red', back_color='blue')
    assert result == ('purple', 'blue', 'red', 'green')
Пример #24
0
def test_kw_new_combo_tup():
    tup = ('green', 'blue', 'purple', 'yellow')
    result = kwargs_ex.fun(*tup)

    # assert result == ('green','blue','purple','yellow', )
    assert result == tup
Пример #25
0
def test_defaults():
    result = kwargs_ex.fun()
    assert result == ("blue", "red", "yellow", "green")
Пример #26
0
def test_tuple():
    tuple = ( "blue", "red", "yellow", "green")
    result = kwargs_ex.fun( *tuple )
    assert result == tuple
Пример #27
0
def test_basic():
    result = kwargs_ex.fun( fore_color="blue",
                            back_color="red",
                            link_color="yellow",
                            visited_color="green")
    assert result == ("blue", "red", "yellow", "green")
Пример #28
0
def test_just_positional_arguements():
    result = kwargs_ex.fun('red', 'blue', 'yellow', 'chartreuse')
    assert result == ('red', 'blue', 'yellow', 'chartreuse')