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')
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')
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')
def test_positional(): result = kwargs_ex.fun( "blue", "red", visited_color="green", link_color="yellow") assert result == ("blue", "red", "yellow", "green")
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")
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')
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')
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')
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')
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')
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')
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')
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')
def test_kw_new_params(): '''test''' result = kwargs_ex.fun('green', 'blue', 'yellow', 'red') assert result == ('blue', 'red', 'yellow', 'green')
def test_kw_combo(): '''test''' result = kwargs_ex.fun('blue', 'red', 'yellow', 'red') assert result == ('blue', 'red', 'yellow', 'red')
def test_basic(): result = kwargs_ex.fun( "blue", "red", "yellow", "green") assert result == ("blue", "red", "yellow", "green")
def test_combination_postional_keyword(): result = kwargs_ex.fun('purple', link_color='red', back_color='blue') assert result == ('purple', 'blue', 'red', 'green')
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
def test_defaults(): result = kwargs_ex.fun() assert result == ("blue", "red", "yellow", "green")
def test_tuple(): tuple = ( "blue", "red", "yellow", "green") result = kwargs_ex.fun( *tuple ) assert result == tuple
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")
def test_just_positional_arguements(): result = kwargs_ex.fun('red', 'blue', 'yellow', 'chartreuse') assert result == ('red', 'blue', 'yellow', 'chartreuse')