Question
Use the function named lbs_to_stones provided below (no changes required) Use unittest to test this function (required 'import' statement provided) Define a class Tests(unittest.TestCase) Define
Use the function named lbs_to_stones provided below (no changes required)
Use unittest to test this function (required 'import' statement provided)
Define a class Tests(unittest.TestCase)
Define a test method named test_lbs_to_stones(self) that contains to assertion tests: 4.1 TEST1: Use assertEqual to test if lbs_to_stones(196) is equal to 14 4.2 TEST2: Use assertEqual to test if lbs_to_stones(140) is equal to 11
RUN CELL containing: if name == 'main' ...* code to invoke the unit tests (code provided)
""" Function that needs to be unit tested """ def lbs_to_stones(lbs): return lbs/14
import unittest
# INSERT YOUR CODE HERE class Tests(unittest.TestCase): def test_lbs_to_stones(self): self.assertEqual('foo'.upper(), 'FOO')
# DO NOT MODIFY! print("QUESTION 3 - ANSWERS")
# PROVIDED CODE - to call your unittest code if __name__ == '__main__': unittest.main(argv=['first-arg-is-ignored'], exit=False)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started