コード例 #1
0
def test_dict2():
    cols = dict(fore_color='orange',
                back_color='black',
                link_color='ground color',
                visited_color='lavender'
                )
    result = colors2(**cols)
    print(result)
    assert result == ('orange', 'black', 'ground color', 'lavender')
コード例 #2
0
def test_tuple_dict2():
    regular = ('red', 'blue')
    links = {'link_color': 'chartreuse'}
    result = colors2(*regular, **links)
    print(result)
    assert result == ('red', 'blue', 'chartreuse', 'lavender')
コード例 #3
0
def test_tuple2():
    color_tup = ('blue', 'red')
    result = colors2(*color_tup)
    assert result == ('blue', 'red', 'green', 'lavender')
コード例 #4
0
def test_default2():
    result = colors2()
    assert result == ('red', 'blue', 'green', 'lavender')
コード例 #5
0
def test_combination2():
    with pytest.raises(TypeError):
        result = colors2('purple', link_color='red', fore_color='blue')
コード例 #6
0
def test_key2():
    result = colors2(link_color='red', back_color='blue')
    assert result == ('red', 'blue', 'red', 'lavender')
コード例 #7
0
def test_pos2():
    result = colors2('red', 'blue', 'yellow', 'chartreuse')
    assert result == ('red', 'blue', 'yellow', 'chartreuse')
コード例 #8
0
def test_colors2_pos():
    result = colors2('green', 'lavender')
    print(type(result))
    print(type(('green', 'lavender', 'green', 'lavender')))
    assert result == ('green', 'lavender', 'green', 'lavender')