Beispiel #1
0
def test_decimal_values():
    """
    If given the floating values ensure they sum correctly.

    """
    assert add(0.1, 0.1, 0.1) == pytest.approx(0.3)
Beispiel #2
0
def test_negative_values():
    """
    if given the negative values ensure they sum correctly
    """
    assert add(-1, -1, -1, -1, -1) == -5
Beispiel #3
0
def test_one_two_three():
    """
    if given the values 1, 2 and 3 as parameters return 6
    """
    assert add(1, 2, 3) == 6
Beispiel #4
0
def test_no_add_parameters():
    """
    if given no input parameters return zero
    """
    assert add() == 0
Beispiel #5
0
def test_three_plus_three():
    """
    if given 3 and 3 as parameters 6 sb returned
    """
    assert add(3, 3) == 6
Beispiel #6
0
def test_two_plus_two():
    """
    if given 2 and 2 as parameters 4 sb returned
    """
    assert add(2, 2) == 4