Example #1
0
def test_multiple_subtractions():
    """
    tests if calculator2 accurately reports a net when multiple values
    are presented including a positive starting number
    """
    assert subtract(-200, 130, 60, 5) == 5
Example #2
0
def test_no_subtract_parameters():
    """
    tests if calculator2 accurately reports a net of zero when no values
    are presented
    """
    assert subtract() == 0
Example #3
0
def test_neg_four_minus_one():
    """
    tests if calculator2 accurately subtracts -4 - 1 to get -5
    """
    assert subtract(4, 1) == -5
Example #4
0
def test_neg_seven_minus_five():
    """
    tests if calculator2 accurately subtracts -7 - 5 to get -12
    """
    assert subtract(7, 5) == -12
def test_only_one_subtract_parameters():
    """
    tests if calculator2 accurately reports a net of the single value
    presented when only one value is given - e.g. 5 gives answer -5
    """
    assert subtract(5) == -5