import pytest from typing import Generator, Dict, Any from faker import Faker from test_utils.data_manager.data_generator import UserDataFactory fake = Faker("zh_CN") @pytest.fixture(scope="function") def test_user_data() -> Dict[str, Any]: return UserDataFactory.create_user_data() @pytest.fixture(scope="function") def test_role_data() -> Dict[str, Any]: return { "role_name": fake.word(), "role_key": fake.word(), "description": fake.sentence(), "status": "0", "permissions": [] } @pytest.fixture(scope="function") def test_menu_data() -> Dict[str, Any]: return { "menu_name": fake.word(), "parent_id": 0, "order_num": fake.random_int(1, 100), "path": f"/{fake.word()}", "component": f"{fake.word()}/{fake.word()}", "menu_type": "C", "visible": "0", "status": "0" } @pytest.fixture(scope="function") def test_dict_data() -> Dict[str, Any]: return { "dict_name": fake.word(), "dict_type": fake.word(), "status": "0", "remark": fake.sentence() } @pytest.fixture(scope="function") def test_config_data() -> Dict[str, Any]: return { "config_name": fake.word(), "config_key": f"sys.{fake.word()}", "config_value": fake.word(), "config_type": "Y", "remark": fake.sentence() }