# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName:   test64
# FileName:      test_dem_api.py
# Author:       lao_zhao
# Datetime:     2024/12/25 10:51
# Description:
# 
# ---------------------------------------------------------------------------
import allure
import pytest
from faker import Faker


class TestDem:

    @allure.epic("BPM-场景测试")
    @allure.feature("维度管理")
    @allure.story("添加维度")
    @allure.title("添加维度的标题")
    @allure.severity("高")
    @pytest.mark.dependency(depends=[r"test_case/test_bpm/test_auth_api.py::TestAuth::test_login[\u6b63\u5411\u7528\u4f8b-case_data0-expect_data0]"], scope="session")
    def test_add_dem(self, req_fix):
        add_dem_url = "http://36.139.193.99:8088/api/demension/v1/dem/addDem"
        data = Faker(locale="zh_cn")
        add_dem_data = {
            "code": f"{data.phone_number()}",
            "description": "",
            "isDefault": 0,
            "name": f"{data.company()}"
        }
        res = req_fix.request(method="post", url=add_dem_url, json=add_dem_data)
        assert "成功" in res.text