appunittest2.py 906 B

12345678910111213141516171819202122232425262728293031
  1. # File Name: appunittest2.py
  2. # Modified Date: March 24, 2017
  3. # Description: This class is for testing message of show error function.
  4. # Method Level Comment: Python Convention (inside function)
  5. __author__ = "Inyoung Choung"
  6. import os
  7. from os import path
  8. import unittest
  9. from implementation import Impl
  10. # testing Show Error function.
  11. class testShowError(unittest.TestCase):
  12. def runTest(self):
  13. """
  14. run Test to check if result is equal to initialized string.
  15. :return:
  16. """
  17. # initialize value to message variable.
  18. message = str("Here is a test warning message.")
  19. # pass the predefined message into alert_message function.
  20. result = Impl.display_message(self, message)
  21. # check if the two values in the parameter are matched.
  22. self.assertEqual(result, message)
  23. # class starter.
  24. if __name__ == '__main__':
  25. unittest.main()