# 靠谱昂 **Repository Path**: chifanxiaofendui/kaopuang ## Basic Information - **Project Name**: 靠谱昂 - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-06-06 - **Last Updated**: 2025-06-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ```markdown # API Test Framework A Python-based framework for automated API testing with built-in utilities for test case generation, HTTP requests, database operations, and more. ## Features - **HTTP Client**: Customizable HTTP client with common request methods (GET, POST, PUT, DELETE, PATCH) - **Test Case Generation**: Automated test case generation from YAML and Excel files - **Database Operations**: Simplified database query and update operations - **Configuration Management**: Centralized config management with YAML support - **Logging**: Custom logging utilities with email support - **Authentication**: Built-in login utilities with token management - **Random Data Generation**: Utilities for generating test data - **Reporting**: Allure report integration ## Installation ### Prerequisites - Python 3.8+ - pip ### Steps 1. Clone the repository: ```bash git clone [repository-url] ``` 2. Install dependencies: ```bash pip install -r requirements.txt ``` 3. Set up configuration: - Modify `config.yaml` as needed for your environment ## Usage ### Running Tests ```bash python run.py [options] ``` ### Example Test Execution ```python from common.http_client import HttpClient from common.logger import log client = HttpClient("https://api.example.com") response = client.get("/endpoint") log(response.json()) ``` ### Generating Test Cases ```python from common.case_tree import CaseTree from common.case_generator import CaseGenerator case_tree = CaseTree("testcase/suite.yml") generator = CaseGenerator(case_tree) generator.generate_case_file("test_suite", cases, "output/test_cases.py") ``` ## Project Structure ``` ├── common/ # Core utilities │ ├── case_generator.py # Test case generation │ ├── case_tree.py # Test case tree structure │ ├── config.py # Configuration management │ ├── db.py # Database operations │ ├── files.py # File operations │ ├── http_client.py # HTTP client │ ├── logger.py # Logging utilities │ ├── login_util/ # Authentication utilities │ ├── randomutil.py # Random data generation │ └── ... # Other utilities ├── testcase/ # Test cases │ ├── conftest.py # Pytest fixtures │ └── ... # Test suites ├── config.yaml # Main configuration ├── gtest.py # Test runner ├── delete_data.py # Data cleanup └── ... ``` ## Configuration Modify `config.yaml` to set up: - Database connections - API endpoints - Email settings for reporting - Environment variables ## Contributing 1. Fork the repository 2. Create your feature branch (`git checkout -b feature/your-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin feature/your-feature`) 5. Create a new Pull Request ## License [MIT License](LICENSE) ```