コード例 #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
コード例 #2
0
def test_no_subtract_parameters():
    """
    tests if calculator2 accurately reports a net of zero when no values
    are presented
    """
    assert subtract() == 0
コード例 #3
0
def test_neg_four_minus_one():
    """
    tests if calculator2 accurately subtracts -4 - 1 to get -5
    """
    assert subtract(4, 1) == -5
コード例 #4
0
def test_neg_seven_minus_five():
    """
    tests if calculator2 accurately subtracts -7 - 5 to get -12
    """
    assert subtract(7, 5) == -12
コード例 #5
0
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