appunittest2.py 699 B

1234567891011121314151617181920212223242526
  1. # File Name: appunittest2.py
  2. # Modified Date: March 24, 2017
  3. # Description: This class is for testing message of show error function
  4. __author__ = "Inyoung Choung"
  5. import os
  6. from os import path
  7. import unittest
  8. import app
  9. # testing Show Error function
  10. class testShowError(unittest.TestCase):
  11. def runTest(self):
  12. # initialize value to message variable.
  13. message = str("Here is a warning message.")
  14. # pass the predefined message into alert_message function.
  15. result = app.alert_message(message)
  16. # check if the two values in the parameter are matched.
  17. self.assertEqual(result, message)
  18. # class starter
  19. if __name__ == '__main__':
  20. unittest.main()