Unittest library helps you to test your program and inform you whether it is working fine. It is useful to recheck if a program is running fine when you make certain changes to any related code. Making a test file makes testing easy. All you need to do later is run this file and it will inform you if a program that you are testing is working fine with all possible inputs. Here is an example of Unitest file working on another file: CAP.PY FILE def capitalizing_text(text): ''' Input string's first letter is capitalized. ''' return text.cap() TEST_CAP.PY FILE #importing unitest library import unittest import cap class TestCap(unittest.TestCase): #functions in test file must start with the word 'test' def test_one_word(self): text = 'python' #running the program result = cap.capitalizing_text(text) #The following line checks if the result and expected result match ...
Project Weekay | Resume | LinkedIn Profile
NodeJS, AWS, MongoDB, ReactJS, Django, Python, ML with Scikit Learn, Matplotlib, Seaborn
Engineering, UX, Marketing, Product Designing, Business
sayhellotovinit@gmail.com | +91 99239 08880 | Pune, India