The taxrate function within the mock-jutsu library serves as a specialised commerce utility designed to generate realistic taxation metadata for software testing. When developers require high-quality mock data to simulate financial transactions, this function provides a structured object containing both the official nomenclature of a tax type—such as KDV or VAT—and its corresponding percentage value. By integrating this tool into a development workflow, teams can ensure that their applications handle regional fiscal requirements with precision, avoiding the common pitfalls of using hardcoded or unrealistic values during the initial stages of system architecture and design.
Under the hood, the taxrate generator leverages a comprehensive internal registry of global taxation standards to produce accurate test data. The algorithm selects from a curated list of international tax identifiers and their current legal rates, ensuring that the output mirrors real-world economic conditions. For instance, a single call might yield a Turkish KDV rate of 20%, while another could return a standard European VAT figure. This variety is essential for developers building multi-regional e-commerce platforms who need to validate that their calculation logic correctly parses nested objects and applies the appropriate mathematical transformations to subtotal figures.
From a practical perspective, the taxrate function is indispensable for several critical testing scenarios. Quality assurance engineers can use it to verify the robustness of checkout flows, ensuring that invoice generation modules correctly display tax labels alongside calculated amounts. It is also highly effective for stress-testing database schemas that store commerce-related metadata. Because mock-jutsu provides consistent output structures, it allows for the seamless creation of complex datasets where tax rates must interact with product prices and shipping costs to produce a final, verifiable total for the end user.
The primary benefit for developers using mock-jutsu lies in its cross-platform accessibility and ease of integration. Whether you are working in a Python environment using the native library, executing quick checks via the CLI, or performing heavy load testing in JMeter with the custom function string, the library maintains a unified interface. This flexibility significantly reduces the time spent on manual data entry and allows engineers to focus on refining core business logic. By automating the generation of taxrate information, mock-jutsu empowers teams to build more resilient, production-ready commerce systems with minimal overhead.
mockjutsu generate taxrate --locale TRmockjutsu generate taxrate --locale DEmockjutsu bulk taxrate --count 10 --locale TRmockjutsu export taxrate --count 10 --format json --locale TRmockjutsu export taxrate --count 10 --format csv --locale TRmockjutsu export taxrate --count 10 --format sql --locale TRfrom mockjutsu import jutsujutsu.generate('taxrate', locale='TR')jutsu.bulk('taxrate', count=10, locale='TR')jutsu.template(['taxrate'], count=5, locale='TR')${__mockjutsu_commerce(taxrate,TR)}# JMeter Function: __mockjutsu_commerce# Parameter 1: taxrate# Parameter 2: locale (TR/UK/US/DE/FR/RU)${__mockjutsu_commerce(taxrate,DE)}GET /generate/taxrate?locale=TR# → {"type":"taxrate","result":"...","status":"ok"}GET /bulk/taxrate?count=10&locale=TRPOST /template {"types":["taxrate"],"count":1,"locale":"TR"}| Parameter | Values | Description |
|---|---|---|
| --locale | TR|UK|US|DE|FR|RU | Region / locale for locale-aware output |