Skip to content

Commit

Permalink
Merge pull request #3 from Robbo-lab/test_for_mulltiplication
Browse files Browse the repository at this point in the history
feat: add multiplcation test and add f2c test include updated to -600…
  • Loading branch information
Robbo-lab authored Mar 18, 2024
2 parents 2c1acf4 + 5a860f5 commit f08c5f7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
Binary file modified __pycache__/functions.cpython-311.pyc
Binary file not shown.
Binary file modified __pycache__/test_functions.cpython-311-pytest-8.0.0.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ def multiply(a, b):
return a * b

def convert_fahrenheit_to_celsius(fahrenheit):
return multiply(subtract(fahrenheit, 32), 9 / 5) # <-- Fix this in step 7
return multiply(subtract(fahrenheit, 32), 5 / 9) # <-- Fix this in step 7
11 changes: 6 additions & 5 deletions test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ def test_add():
def test_subtract():
assert subtract(2, 3) == -1

def test_multiply():
assert multiply(2, 3) == 6

# uncomment the following test in step 11
# def test_convert_fahrenheit_to_celsius():
# assert f2c(32) == 0
# assert f2c(122) == pytest.approx(50)
# with pytest.raises(AssertionError):
# f2c(-600)
def test_convert_fahrenheit_to_celsius():
assert f2c(32) == 0
assert f2c(122) == pytest.approx(50)
assert f2c(-600) == pytest.approx(-351.1, abs=0.05)

0 comments on commit f08c5f7

Please sign in to comment.