Commit 5c181acf authored by 张伟男's avatar 张伟男

AI根据五官推荐美购

parent 95ba9a05
......@@ -13,6 +13,16 @@ class oneimage_request(BaseRequest):
return self.api_send(self.data["share_v4"])
# 测颜值结果页,根据五官推荐美购接口
def recomend_services(self,version,business_tags_names):
self.params["version"] = version
self.params["business_tags_names"] = business_tags_names
return self.api_send(self.data["recomend_services"])
if __name__ == '__main__':
print(oneimage_request().share_v4("7.42.2", "27320150"))
\ No newline at end of file
print(oneimage_request().share_v4("7.42.2", "27320150"))
business_tags_names = '[[],[],["玻尿酸垫下巴","自体脂肪垫下巴","硅胶垫下巴","膨体垫下巴"],["半永久纹眉","植眉"],["玻尿酸丰唇","胶原蛋白填充丰唇","自体脂肪丰唇"],[],["开内眼角"],["射频提升","热拉提","热拉提plus","热玛吉","超声提升"],["热玛吉"],[],["注射瘦脸","激光溶脂瘦脸","取颊脂垫瘦脸","光纤溶脂瘦脸","下颌角整形"]]'
print(oneimage_request().recomend_services("7.42.2", business_tags_names))
\ No newline at end of file
#测肤结果页
share_v4:
method: post
url: /api/one_image/share/v4
......@@ -7,4 +8,11 @@ share_v4:
face_id: ${face_id}
json: {}
#测肤结果根据五官推荐美购
recomend_services:
method: get
url: /api/one_image/recomend/services
params:
version: ${version}
business_tags_names: ${business_tags_names}
json: {}
develop_host:
# backend: http://backend.paas-develop.env
doctor: http://doctor.paas-develop.env
backend: https://backend.igengmei.com
# doctor: http://doctor.paas-develop.env
......@@ -64,9 +64,9 @@ class BaseRequest:
host = self.api_load(path_setting.HOSTYAML_CONFIG)
url_host = ""
if host["develop_host"].get("doctor") == "http://doctor.paas-develop.env":
if host["develop_host"].get("doctor") is not None:
url_host = host['develop_host']['doctor']
elif host["develop_host"].get("backend") == "http://backend.paas-develop.env":
elif host["develop_host"].get("backend") is not None:
url_host = host['develop_host']['backend']
raw = yaml.dump(req) # 将一个python对象生成为yaml文档
......@@ -86,7 +86,7 @@ class BaseRequest:
params=req.get('params'),
# headers=user_headers,
data=req.get('data'),
json=req.get('json')
json=req.get('json'),verify=False
)
return r.json()
......
......@@ -46,6 +46,7 @@ FEED_INDEXV9_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/feed_
# 测颜值结果页
ONEIMAGE_SHARE_V4_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "oneimage_request.yaml")
ONEIMAGE_SHARE_V4_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/oneimage_data", "share_v4.yaml")
ONEIMAGE_RECOMEND_SERVICES_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/oneimage_data", "recomend_services.yaml")
LOGIN_PASSWD = os.path.join(BASE_DIR, "backend_auto/test_backend_data/accounts_data", "login_passwd.yaml")
LOGIN_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "accounts_request.yaml")
......
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.oneimage_request import oneimage_request
# 测颜值根据五官推荐美购
class TestRecomendServices:
data = BaseRequest().api_load(path_setting.ONEIMAGE_RECOMEND_SERVICES_DATA)
recomendservice_case, recomendservice_data = get_ids(data, "recomend_services")
@pytest.mark.parametrize("param",recomendservice_data,ids=recomendservice_case)
def test_recomend_services(self,param):
r = oneimage_request().recomend_services(param["version"], param["business_tags_names"])
assert r["error"] == param["assert"]
recomend_services:
#成功登录case
-
case: "请求成功,有数据返回"
version: "7.42.2"
business_tags_names: '[[],[],["玻尿酸垫下巴","自体脂肪垫下巴","硅胶垫下巴","膨体垫下巴"],["半永久纹眉","植眉"],["玻尿酸丰唇","胶原蛋白填充丰唇","自体脂肪丰唇"],[],["开内眼角"],["射频提升","热拉提","热拉提plus","热玛吉","超声提升"],["热玛吉"],[],["注射瘦脸","激光溶脂瘦脸","取颊脂垫瘦脸","光纤溶脂瘦脸","下颌角整形"]]'
assert: 0
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment