12345678910111213141516171819202122232425262728 |
- import unittest
- from pathlib import Path
- from testing.utils import *
- class TestIdCardAddress(unittest.TestCase):
- def _helper(self, image_path, name):
- root = Path(__file__).parent
- image_path = str(root / image_path)
- r = send_request(image_path, '0')
- self.assertEqual(name, r['result']['name']['text'], f'{image_path} name case error')
- def test_01(self):
- image_path = '../images/false/miss_name/01.jpg'
- self._helper(image_path, '董建')
- def test_02(self):
- image_path = '../images/false/miss_name/02.jpg'
- self._helper(image_path, '朱变变')
- if __name__ == '__main__':
- unittest.main()
|