import pytest

from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.gmai_request import gmai_request

# 模拟发型，眉毛，美瞳
class TestSimulateAnalyze:
    data = BaseRequest().api_load(path_setting.GMAI_SIMULATE_ANALYZE_DATA)
    simulateanalyze_case, simulateanalyze_data = get_ids(data, "simulate_analyze")

    @pytest.mark.parametrize("param",simulateanalyze_data,ids=simulateanalyze_case)
    def test_plastic_analysis_v3(self,param):
        r = gmai_request().simulate_analyze(param["device_id"], param["image_url"], param["style_id"] ,param["type_id"])
        assert r["error"] == 0
        gm_url = r["data"]["plastic_image_url"]
        content = r["data"]["content"]
        print("效果图:  ", gm_url)
        print("效果文案:  ", content)
        before_charm_val = r["data"]["before_charm_val"]
        after_charm_val = r["data"]["after_charm_val"]
        assert before_charm_val < after_charm_val