示例#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")
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
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')
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')
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')
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')
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')