You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.1 KiB

  1. # -*- coding: utf-8 -*-
  2. from email import message
  3. import unittest
  4. from validate.format import error_message
  5. class TestValidadeFormat(unittest.TestCase):
  6. def test_error_message_return_and_return_type(self):
  7. line_num_unity = 1
  8. line_num_ten = 10
  9. line_num_hundred = 100
  10. line_num_thousand = 1000
  11. msg = 'This is a unit test'
  12. err_msg_unity = error_message(line_num_unity, msg)
  13. err_msg_ten = error_message(line_num_ten, msg)
  14. err_msg_hundred = error_message(line_num_hundred, msg)
  15. err_msg_thousand = error_message(line_num_thousand, msg)
  16. self.assertIsInstance(err_msg_unity, str)
  17. self.assertIsInstance(err_msg_ten, str)
  18. self.assertIsInstance(err_msg_hundred, str)
  19. self.assertIsInstance(err_msg_thousand, str)
  20. self.assertEqual(err_msg_unity, '(L002) This is a unit test')
  21. self.assertEqual(err_msg_ten, '(L011) This is a unit test')
  22. self.assertEqual(err_msg_hundred, '(L101) This is a unit test')
  23. self.assertEqual(err_msg_thousand, '(L1001) This is a unit test')