Exemplo n.º 1
0
def test_length():
    """
    the function should return a list of the length input
    """
    assert len(function_builder(0)) == 0

    assert len(function_builder(3)) == 3

    assert len(function_builder(5)) == 5
def test_function_builder():
    '''
	Test that items in function list
	are returning correct values
	'''
    the_list = ll.function_builder(4)
    assert the_list[0](2) == 2
    assert the_list[1](2) == 3
def test_function_builder():
	'''
	Test that items in function list
	are returning correct values
	'''
	the_list = ll.function_builder(4)
	assert the_list[0](2) == 2
	assert the_list[1](2) == 3
Exemplo n.º 4
0
def test_increment2():
    """
    the functions in the list should increment the input values
    """

    func_list = function_builder(10)

    assert func_list[0](12) == 12

    assert func_list[1](10) == 11

    assert func_list[9](3) == 12
Exemplo n.º 5
0
def test_increment():
    """
    the functions in the list should increment the input values
    """
    func_list = function_builder(5)

    assert func_list[0](3) == 3

    assert func_list[1](3) == 4

    assert func_list[2](3) == 5

    assert func_list[3](3) == 6