devdox-ai-locust 0.1.1__tar.gz → 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/PKG-INFO +1 -1
  2. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/pyproject.toml +2 -2
  3. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust/config.py +1 -1
  4. devdox_ai_locust-0.1.2/src/devdox_ai_locust/prompt/domain.j2 +33 -0
  5. devdox_ai_locust-0.1.2/src/devdox_ai_locust/prompt/locust.j2 +22 -0
  6. devdox_ai_locust-0.1.2/src/devdox_ai_locust/prompt/test_data.j2 +62 -0
  7. devdox_ai_locust-0.1.2/src/devdox_ai_locust/prompt/validation.j2 +17 -0
  8. devdox_ai_locust-0.1.2/src/devdox_ai_locust/prompt/workflow.j2 +145 -0
  9. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust.egg-info/PKG-INFO +1 -1
  10. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust.egg-info/SOURCES.txt +5 -0
  11. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/tests/test_config.py +4 -4
  12. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/LICENSE +0 -0
  13. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/README.md +0 -0
  14. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/setup.cfg +0 -0
  15. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust/__init__.py +0 -0
  16. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust/cli.py +0 -0
  17. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust/hybrid_loctus_generator.py +0 -0
  18. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust/locust_generator.py +0 -0
  19. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust/py.typed +0 -0
  20. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust/schemas/__init__.py +0 -0
  21. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust/schemas/processing_result.py +0 -0
  22. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust/templates/base_workflow.py.j2 +0 -0
  23. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust/templates/config.py.j2 +0 -0
  24. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust/templates/custom_flows.py.j2 +0 -0
  25. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust/templates/endpoint_template.py.j2 +0 -0
  26. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust/templates/env.example.j2 +0 -0
  27. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust/templates/fallback_locust.py.j2 +0 -0
  28. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust/templates/locust.py.j2 +0 -0
  29. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust/templates/readme.md.j2 +0 -0
  30. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust/templates/requirement.txt.j2 +0 -0
  31. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust/templates/test_data.py.j2 +0 -0
  32. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust/templates/utils.py.j2 +0 -0
  33. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust/utils/__init__.py +0 -0
  34. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust/utils/file_creation.py +0 -0
  35. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust/utils/open_ai_parser.py +0 -0
  36. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust/utils/swagger_utils.py +0 -0
  37. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust.egg-info/dependency_links.txt +0 -0
  38. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust.egg-info/entry_points.txt +0 -0
  39. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust.egg-info/requires.txt +0 -0
  40. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/src/devdox_ai_locust.egg-info/top_level.txt +0 -0
  41. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/tests/test_cli.py +0 -0
  42. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/tests/test_data.py +0 -0
  43. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/tests/test_hybrid_loctus_generator.py +0 -0
  44. {devdox_ai_locust-0.1.1 → devdox_ai_locust-0.1.2}/tests/test_locust_generator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devdox_ai_locust
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: AI-powered Locust load test generator from API documentation
5
5
  Author-email: Hayat Bourji <hayat.bourgi@montyholding.com>
6
6
  Maintainer-email: Hayat Bourji <hayat.bourgi@montyholding.com>
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
 
6
6
  [project]
7
7
  name = "devdox_ai_locust"
8
- version = "0.1.1"
8
+ version = "0.1.2"
9
9
  description = "AI-powered Locust load test generator from API documentation"
10
10
  readme = "README.md"
11
11
  license = {text = "Apache-2.0" }
@@ -101,7 +101,7 @@ exclude = ["tests*"]
101
101
 
102
102
 
103
103
  [tool.setuptools.package-data]
104
- devdox_ai_locust = ["schemas/*.json", "templates/*.j2", "py.typed"]
104
+ devdox_ai_locust = ["schemas/*.json", "templates/*.j2","prompt/*.j2", "py.typed","*.j2"]
105
105
 
106
106
  # flake8 configuration (legacy - remove if using ruff)
107
107
  [tool.flake8]
@@ -8,7 +8,7 @@ from pydantic_settings import BaseSettings
8
8
  class Settings(BaseSettings):
9
9
  """Application settings."""
10
10
 
11
- VERSION: str = "0.1.1"
11
+ VERSION: str = "0.1.2"
12
12
 
13
13
  API_KEY: str = "" # Fallback for backward compatibility
14
14
 
@@ -0,0 +1,33 @@
1
+ Based on this API analysis, create domain-specific user flows for Locust testing:
2
+ {{domain_analysis}}
3
+
4
+ API Analysis: Use the analyze_api_domain function output which includes:
5
+ - API Title and Description
6
+ - Total Endpoints count
7
+ - HTTP Methods used
8
+ - Common Path Patterns
9
+ - Main Resources identified
10
+
11
+ Endpoints Available: Complete Swagger documentation with all endpoint details including:
12
+ {{ endpoints }}
13
+
14
+ # Limit for token efficiency
15
+
16
+ Generate a Python file with domain-specific user flow classes that extend the base CustomUserFlow. Focus on realistic business workflows that users would actually perform.
17
+
18
+ Requirements:
19
+ 1. Create 2-3 domain-specific flow classes based on the identified main resources
20
+ 2. Use sequential tasks for related API calls and use correlation between them
21
+ 3. To check payload and update it if it is not valid using the Swagger schemas
22
+ 4. Each flow should represent a complete business process workflow
23
+ 5. Include proper error handling and realistic wait times
24
+ 6. Use the available endpoints from Swagger documentation in logical sequences
25
+ 7. Add meaningful logging and data tracking
26
+ 8. Parse Swagger schemas to generate valid request payloads
27
+ 9. Implement data correlation (e.g., use created resource IDs in subsequent calls)
28
+ 10. Add requirement sent by developer:{{ custom_requirement }}
29
+
30
+ Always return your code wrapped in <code></code> tags with no explanations outside the tags
31
+ DO NOT TRUNCATE THE CODE. IMPORTANT: Return the SAME code with ONLY formatting fixes. Do not enhance or add anything
32
+
33
+ Format: <code>your_python_code_here</code>
@@ -0,0 +1,22 @@
1
+ Enhance this Locust test file to be more professional and realistic and fix the indentation issues:
2
+
3
+ ```python
4
+ {{ base_content }}
5
+ ```
6
+
7
+ Available Endpoints: {{ endpoints_for_prompt }}
8
+ API Info: {{ api_info.title }} v {{ api_info.version }}
9
+
10
+ Fix ONLY the formatting and indentation issues in this Locust test file.
11
+
12
+ STRICT REQUIREMENTS:
13
+ - Fix indentation and formatting ONLY
14
+ - Do NOT add new tasks, methods, or endpoints
15
+ - Do NOT modify existing task logic
16
+ - Do NOT add new functionality
17
+ - Keep the exact same tasks and methods
18
+ - Only fix Python syntax, imports, and indentation
19
+
20
+ Always return your code wrapped in <code></code> tags with no explanations outside the tags DO NOT TRUNCATE THE CODE.
21
+ IMPORTANT: Return the SAME code with ONLY formatting fixes. Do not enhance or add anything
22
+ Format: <code>your_python_code_here</code>:
@@ -0,0 +1,62 @@
1
+ Enhance this test data generator with domain-specific realistic data while preserving ALL existing methods and their signatures:
2
+
3
+ Current File:
4
+ {{base_content}}
5
+
6
+ API Schemas Found:
7
+ {{ schemas_info }}
8
+
9
+ API Endpoints Context:
10
+ [
11
+ {% for ep in endpoints -%}
12
+ "Path: {{ ep.path }}, Method: {{ ep.method }}, Tags: {{ ep.tags }}"{% if not loop.last %},{% endif %}
13
+ {% endfor -%}
14
+ ]
15
+
16
+ REQUIREMENTS - Enhance by adding NEW functionality while keeping ALL existing methods intact:
17
+
18
+ 1. **Domain-Specific Data Generators**:
19
+ - Add methods like `generate_affiliate_data()`, `generate_user_credentials()`, `generate_product_data()`
20
+ - Create realistic data based on API endpoint patterns (affiliate, user, product, etc.)
21
+ - Add specific payload generators for common API patterns
22
+
23
+ 2. **Realistic ID Generation**:
24
+ - Add `generate_realistic_id(entity_type: str)` for entity-specific IDs
25
+ - Create correlated IDs (user_id -> session_id -> transaction_id)
26
+ - Add methods like `generate_affiliate_id()`, `generate_partner_id()`, etc.
27
+
28
+ 3. **Payload Templates**:
29
+ - Add `get_payload_template(endpoint_path: str, method: str)`
30
+ - Create endpoint-specific payload generators
31
+ - Add `generate_login_payload()`, `generate_registration_payload()`, etc.
32
+
33
+ 4. **Data Relationships & Correlation**:
34
+ - Add session management: `create_user_session()`, `get_session_data()`
35
+ - Create data dependency chains (parent-child relationships)
36
+ - Add `link_related_entities(parent_id, child_type)` for realistic relationships
37
+
38
+ 5. **Smart Caching & Performance**:
39
+ - Add `cache_generated_data(key, data)` and `get_cached_data(key)`
40
+ - Create reusable entity pools for better performance
41
+ - Add `get_or_create_entity(entity_type, **kwargs)`
42
+
43
+ 6. **Specialized Pattern Generators**:
44
+ - Add `generate_api_key_data()`, `generate_webhook_payload()`
45
+ - Create `generate_pagination_data()`, `generate_filter_data()`
46
+ - Add `generate_error_scenarios()` for negative testing
47
+
48
+ 7. **Validation & Constraints**:
49
+ - Add `validate_generated_data(data, schema)`
50
+ - Create constraint-aware generation
51
+ - Add business rule validation
52
+
53
+ CRITICAL CONSTRAINTS:
54
+ - MUST preserve ALL existing method signatures exactly as they are
55
+ - MUST keep all existing functionality working
56
+ - MUST maintain backward compatibility
57
+ - ADD new methods, don't modify existing ones
58
+ - Keep the global `test_data_generator` instance
59
+
60
+ Focus on making the data generation smarter and more realistic while ensuring all existing code that imports and uses this generator continues to work without changes.
61
+
62
+ Output: Complete enhanced Python file with ALL existing content preserved + new intelligent features
@@ -0,0 +1,17 @@
1
+ Enhance this utils file with smarter response validation:
2
+
3
+ Current File:
4
+ {{base_content}}
5
+
6
+ Validation Patterns Needed:
7
+ {{ validation_patterns }}
8
+
9
+ Enhance by:
10
+ 1. Adding endpoint-specific validation rules
11
+ 2. Creating schema-based response validation
12
+ 3. Adding business logic validation
13
+ 4. Implementing response data integrity checks
14
+ 5. Adding performance threshold validation
15
+
16
+ Keep existing utility functions but add smarter validation logic.
17
+ Output: Complete enhanced Python file content.
@@ -0,0 +1,145 @@
1
+ CRITICAL CONSTRAINTS: Only use endpoints that exist in the OpenAPI specification. DO NOT create, modify, or reference any endpoints not listed below.
2
+ TASK: Enhance this Locust workflow file with realistic load testing patterns and LOGICAL TASK ORDERING.
3
+ STRICT REQUIREMENTS:
4
+ 1. ONLY use these exact API endpoints from OpenAPI spec:
5
+ {{ grouped_enpoints }}
6
+ 2. Check Authentication Endpoints :
7
+ {{ auth_endpoints }}
8
+ - If their is endpoints to login , add login task at the beginning of the workflow If we don't have login endpoint, we can't login and retry the task
9
+ - In case of getting 401 so login and retry the task
10
+ - If their is endpoints to logout , add logout task at the end of the workflow
11
+ 3. PRESERVE EXISTING STRUCTURE:
12
+ - Keep ALL existing @task methods, classes, and functions
13
+ - DO NOT remove any existing functionality
14
+ - DO NOT change existing method signatures unless enhancing them
15
+ - ADD to existing methods, don't replace them
16
+ 4. ADD NEW FUNCTIONALITY WHEN NEEDED:
17
+ - If an API endpoint requires specific IDs, ADD new methods to generate/store those IDs
18
+ - ADD new test data generators to test_data.py functions
19
+ - ADD new example usage patterns to example.py
20
+ - CREATE data flow between related API calls
21
+
22
+ 5. DATA FLOW AND ID MANAGEMENT:
23
+ - ADD instance variables to store IDs (self.reseller_id, self.user_id, etc.)
24
+ - ADD methods to extract and store IDs from API responses
25
+ - ADD logic to use stored IDs in subsequent API calls
26
+ - CREATE realistic data dependencies between tasks
27
+
28
+ 6. ENHANCEMENT AREAS (ADD, don't replace):
29
+ - ADD better error handling to existing methods
30
+ - ADD realistic test data usage from test_data.py
31
+ - ADD authentication handling if auth endpoints exist
32
+ - ADD cleanup methods for created resources
33
+ - ADD data correlation between sequential tasks
34
+
35
+
36
+ CURRENT WORKFLOW FILE:
37
+ {{base_content}}
38
+
39
+ BASE WORKFLOW: {{base_workflow}}
40
+
41
+ TEST DATA AVAILABLE: {{test_data_content}}
42
+ 1. **REORDER TASKS FOR LOGICAL FLOW**: Arrange @task methods in a meaningful business workflow sequence:
43
+
44
+ - Start with data creation tasks (e.g., add_reseller)
45
+
46
+ - Follow with data retrieval to get IDs for subsequent operations (e.g., get_reseller, get_reseller_by_id)
47
+
48
+ - Then perform operations using those IDs (e.g., customize_corporate_price, available_reseller_properties)
49
+
50
+ - End with cleanup operations (e.g., delete_reseller)
51
+
52
+
53
+
54
+ 2. **DATA CORRELATION**: Use data from previous tasks in subsequent tasks:
55
+
56
+ - Store reseller IDs from add_reseller for use in get_reseller_by_id, customize_price, etc.
57
+
58
+ - Pass generated data between related API calls
59
+
60
+ - Maintain state between sequential tasks for realistic workflows
61
+
62
+ 3. Fix indentation issues
63
+
64
+
65
+ 4. **Test Data Enhancement** (if needed, suggest additions):
66
+ If APIs need specific data formats, suggest:
67
+ - New functions to add to test_data.py
68
+ - New example patterns to add to example.py
69
+ - New data generators for specific ID requirements
70
+
71
+
72
+
73
+ 5. Use realistic functions and classes from base_workflow.py and don't remove classes or functions from this file
74
+
75
+ 6. Add intelligent request chaining between related API calls
76
+
77
+ 7. Add authentication handling ONLY if auth endpoints exist in OpenAPI spec
78
+
79
+ 8. Add error recovery for existing methods
80
+
81
+ 9. Add data cleanup on stop for resources created during testing
82
+
83
+ 10. Improve data parameterization using available test data generators
84
+
85
+
86
+
87
+ LOGICAL TASK SEQUENCE EXAMPLE:
88
+
89
+ For reseller workflow, the logical order should be:
90
+
91
+ 1. add_reseller (create) → store reseller_id
92
+
93
+ 2. get_reseller (list/search)
94
+
95
+ 3. get_reseller_by_id (using stored reseller_id)
96
+
97
+ 4. available_reseller_properties (using reseller_id)
98
+
99
+ 5. customize_corporate_price (using reseller_id)
100
+
101
+ 6. customize_corporate_price_csv (using reseller_id)
102
+
103
+ 7. customize_price (using reseller_id)
104
+
105
+ 8. customize_price_csv (using reseller_id)
106
+
107
+ 9. topup_reseller_balance (using reseller_id)
108
+
109
+ 10. edit_reseller (using reseller_id)
110
+
111
+ 11. delete_reseller (cleanup using reseller_id)
112
+
113
+ VALIDATION RULES:
114
+ - Every @task method must correspond to an actual OpenAPI endpoint
115
+ - PRESERVE all existing functionality
116
+ - ADD new functionality only where needed for data flow
117
+ - Use only test_data.py functions that exist or suggest new ones to ADD
118
+ - Ensure realistic user workflows with proper data dependencies
119
+ - ADD error handling and resource cleanup
120
+
121
+ SUGGESTIONS FOR ADDITIONS (if needed):
122
+ If the workflow needs new test data generators or example patterns,
123
+ provide suggestions for what to ADD to:
124
+
125
+ test_data.py additions:
126
+ ```python
127
+ # Suggest new functions to ADD (don't replace existing)
128
+ def get_specific_id_data():
129
+ # New function for ID-dependent APIs
130
+ pass
131
+ ```
132
+
133
+ example.py additions:
134
+ ```python
135
+ # Suggest new example patterns to ADD
136
+ def example_id_workflow():
137
+ # New example showing ID usage
138
+ pass
139
+ ```
140
+
141
+ Return the complete enhanced file in <code></code> tags without truncation.
142
+
143
+
144
+ Format:
145
+ <code>your_complete_enhanced_python_code_here</code>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devdox_ai_locust
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: AI-powered Locust load test generator from API documentation
5
5
  Author-email: Hayat Bourji <hayat.bourgi@montyholding.com>
6
6
  Maintainer-email: Hayat Bourji <hayat.bourgi@montyholding.com>
@@ -13,6 +13,11 @@ src/devdox_ai_locust.egg-info/dependency_links.txt
13
13
  src/devdox_ai_locust.egg-info/entry_points.txt
14
14
  src/devdox_ai_locust.egg-info/requires.txt
15
15
  src/devdox_ai_locust.egg-info/top_level.txt
16
+ src/devdox_ai_locust/prompt/domain.j2
17
+ src/devdox_ai_locust/prompt/locust.j2
18
+ src/devdox_ai_locust/prompt/test_data.j2
19
+ src/devdox_ai_locust/prompt/validation.j2
20
+ src/devdox_ai_locust/prompt/workflow.j2
16
21
  src/devdox_ai_locust/schemas/__init__.py
17
22
  src/devdox_ai_locust/schemas/processing_result.py
18
23
  src/devdox_ai_locust/templates/base_workflow.py.j2
@@ -15,7 +15,7 @@ class TestSettings:
15
15
  """Test default settings values."""
16
16
  test_settings = Settings(_env_file=".env.example")
17
17
 
18
- assert test_settings.VERSION == "0.1.1"
18
+ assert test_settings.VERSION == "0.1.2"
19
19
  assert test_settings.API_KEY == ""
20
20
 
21
21
  def test_settings_with_env_vars(self):
@@ -108,7 +108,7 @@ class TestSettings:
108
108
  def test_global_settings_instance(self):
109
109
  """Test the global settings instance."""
110
110
  assert isinstance(settings, Settings)
111
- assert settings.VERSION == "0.1.1"
111
+ assert settings.VERSION == "0.1.2"
112
112
 
113
113
 
114
114
  class TestSettingsMethods:
@@ -120,7 +120,7 @@ class TestSettingsMethods:
120
120
  original_version = test_settings.VERSION
121
121
 
122
122
  # VERSION should be a class-level constant
123
- assert original_version == "0.1.1"
123
+ assert original_version == "0.1.2"
124
124
 
125
125
  # Even if we try to change it, it should remain the same
126
126
  # (depending on Pydantic implementation)
@@ -131,7 +131,7 @@ class TestSettingsMethods:
131
131
 
132
132
  # Create new instance to verify class-level value
133
133
  new_settings = Settings()
134
- assert new_settings.VERSION == "0.1.1"
134
+ assert new_settings.VERSION == "0.1.2"
135
135
 
136
136
  def test_settings_field_types(self):
137
137
  """Test that settings fields have correct types."""