123456789101112131415161718192021222324252627282930313233343536373839404142 |
- # File Name: appunittest2.py
- # Modified Date: March 24, 2017
- # Description: This class is for testing message of show error function.
- # Method Level Comment: Python Convention (inside function)
- __author__ = "Inyoung Choung"
- import os
- from os import path
- import unittest
- from implementation import Impl
- # testing Show Error function.
- class testShowError(unittest.TestCase):
- def runTest(self):
- """
- run Test to check if result is equal to initialized string.
- :return:
- """
- # initialize value to message variable.
- message = str("Here is a test warning message.")
- # pass the predefined message into alert_message function.
- result = Impl.display_message(self, message)
- import app
- # testing Show Error function
- class testShowError(unittest.TestCase):
- def runTest(self):
- # initialize value to message variable.
- message = str("Here is a warning message.")
- # pass the predefined message into alert_message function.
- result = app.alert_message(message)
- # check if the two values in the parameter are matched.
- self.assertEqual(result, message)
- # class starter
- if __name__ == '__main__':
- unittest.main()
|