|
@@ -1,17 +1,17 @@
|
|
|
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['sb']
|
|
|
-token = config.TOKEN['sb']
|
|
|
+# DX_test, DX_sb, DX_test, DX_sb
|
|
|
+url = config.URL['DX_sb']
|
|
|
+token = config.TOKEN['DX_sb']
|
|
|
|
|
|
-class TestOcr(unittest.TestCase):
|
|
|
+# 生产集群
|
|
|
+class TestSbOcr(unittest.TestCase):
|
|
|
|
|
|
def _helper(self, image_path, suffix):
|
|
|
root = Path(__file__).parent
|
|
@@ -44,18 +44,46 @@ class TestOcr(unittest.TestCase):
|
|
|
suffix = '/cet/cet'
|
|
|
self._helper(image_path, suffix)
|
|
|
|
|
|
+ def test_blef(self):
|
|
|
+ image_path = './image/blfe.jpg'
|
|
|
+ suffix = '/blfe/blfe'
|
|
|
+ self._helper(image_path, suffix)
|
|
|
+
|
|
|
+# 测试集群
|
|
|
+class TestOcr(unittest.TestCase):
|
|
|
|
|
|
-# 测试营业执照
|
|
|
-URL = config.URL['blfe']
|
|
|
-token1 = config.TOKEN['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)
|
|
|
+ r = send_request(image_path, suffix, url, token)
|
|
|
self.assertIn('result', r, f'{suffix} test error')
|
|
|
|
|
|
- def test_blfe(self):
|
|
|
+ def test_bank(self):
|
|
|
+ image_path = './image/bankcard.jpg'
|
|
|
+ suffix = '/yhksbtest/bankcard'
|
|
|
+ self._helper(image_path, suffix)
|
|
|
+
|
|
|
+ def test_idcard(self):
|
|
|
+ image_path = './image/idcard.jpg'
|
|
|
+ suffix = '/sfzsbtest/idcard'
|
|
|
+ self._helper(image_path, suffix)
|
|
|
+
|
|
|
+ def test_regbook(self):
|
|
|
+ image_path = './image/regbook.jpg'
|
|
|
+ suffix = '/hkbsbtest/regbook'
|
|
|
+ self._helper(image_path, suffix)
|
|
|
+
|
|
|
+ def test_schoolcert(self):
|
|
|
+ image_path = './image/schoolcert.jpg'
|
|
|
+ suffix = '/xxwtest/schoolcert'
|
|
|
+ self._helper(image_path, suffix)
|
|
|
+
|
|
|
+ def test_cet(self):
|
|
|
+ image_path = './image/cet.jpg'
|
|
|
+ suffix = '/cettest/cet'
|
|
|
+ self._helper(image_path, suffix)
|
|
|
+
|
|
|
+ def test_blef(self):
|
|
|
image_path = './image/blfe.jpg'
|
|
|
suffix = '/blfetest/blfe'
|
|
|
self._helper(image_path, suffix)
|