connie_tong

导航

 
# test suite 
import unittest 
  
class TestStringMethods(unittest.TestCase):
    # test function to test whether key is present in container 
    def test_negative(self):
        key = "gee123"
        container = "geeksforgeeks"
        # error message in case if test case got failed 
        message = "key is not in container."
        # assertIn() to check if key is in container 
        self.assertIn(key, container, message) 
  
if __name__ == '__main__':
    unittest.main()

 

 

# test suite 
import unittest 
  
class TestStringMethods(unittest.TestCase):
    # test function to test whether key is present in container 
    def test_negative(self):
        key = "gee"
        container = "geeksforgeeks"
        # error message in case if test case got failed 
        message = "key is not in container."
        # assertIn() to check if key is in container 
        self.assertIn(key, container, message) 
  
if __name__ == '__main__':
    unittest.main()

 

posted on 2021-03-05 10:26  connie_tong  阅读(748)  评论(0编辑  收藏  举报