|
@@ -1,14 +1,15 @@
|
|
|
import base64
|
|
|
from pathlib import Path
|
|
|
import unittest
|
|
|
+import requests
|
|
|
import config
|
|
|
from config import send_request
|
|
|
|
|
|
image_path = 'image'
|
|
|
|
|
|
# test, sb ,idc
|
|
|
-url = config.URL['idc']
|
|
|
-token = config.TOKEN['idc']
|
|
|
+url = config.URL['sb']
|
|
|
+token = config.TOKEN['sb']
|
|
|
|
|
|
class TestOcr(unittest.TestCase):
|
|
|
|
|
@@ -42,3 +43,19 @@ class TestOcr(unittest.TestCase):
|
|
|
image_path = './image/cet.jpg'
|
|
|
suffix = '/cet/cet'
|
|
|
self._helper(image_path, suffix)
|
|
|
+
|
|
|
+
|
|
|
+# 测试营业执照
|
|
|
+URL = config.URL['blfe']
|
|
|
+class TestBlfeOcr(unittest.TestCase):
|
|
|
+ def _helper(self, image_path, suffix):
|
|
|
+ root = Path(__file__).parent
|
|
|
+ image_path = str(root / image_path)
|
|
|
+ r = send_request(image_path, suffix, URL, token)
|
|
|
+ self.assertIn('result', r, f'{suffix} test error')
|
|
|
+
|
|
|
+ def test_blfe(self):
|
|
|
+ image_path = './image/blfe.jpg'
|
|
|
+ suffix = '/blfetest/blfe'
|
|
|
+ self._helper(image_path, suffix)
|
|
|
+
|