name_test.py 675 B

12345678910111213141516171819202122232425262728
  1. import unittest
  2. from pathlib import Path
  3. from testing.utils import *
  4. class TestIdCardAddress(unittest.TestCase):
  5. def _helper(self, image_path, name):
  6. root = Path(__file__).parent
  7. image_path = str(root / image_path)
  8. r = send_request(image_path, '0')
  9. self.assertEqual(name, r['result']['name']['text'], f'{image_path} name case error')
  10. def test_01(self):
  11. image_path = '../images/false/miss_name/01.jpg'
  12. self._helper(image_path, '董建')
  13. def test_02(self):
  14. image_path = '../images/false/miss_name/02.jpg'
  15. self._helper(image_path, '朱变变')
  16. if __name__ == '__main__':
  17. unittest.main()