The taxrate function within the mock-jutsu library is a specialized tool designed for developers and QA engineers who need to simulate realistic financial transactions. As a core component of the commerce category, this function generates structured mock data representing various global taxation systems. Each output provides a realistic pairing of a tax identifier, such as VAT, GST, or KDV, alongside its corresponding numerical percentage. By leveraging this function, development teams can ensure their applications handle diverse fiscal requirements without the need for manual data entry or static configuration files.
Technically, mock-jutsu utilizes an internal dataset aligned with international commerce standards to provide plausible test data. When a developer invokes the taxrate function, the library returns a structured object, typically formatted as {name:KDV, rate:20}. This consistency is maintained across multiple interfaces, allowing for a unified testing experience. Whether you are working directly in a script using the Python command jutsu.generate('taxrate'), executing quick checks via the CLI with mockjutsu generate taxrate, or conducting heavy-duty performance testing in JMeter with the ${__mockjutsu(taxrate,)} syntax, the data remains reliable and contextually accurate.
The primary benefit of using the taxrate function lies in its versatility across various testing scenarios. It is particularly effective for validating e-commerce checkout flows, where accurate tax calculation is critical for customer trust and legal compliance. Developers can use this mock data to test invoice generation modules, accounting software integrations, and edge-case scenarios involving different regional tax brackets. By simulating a wide array of tax rates, teams can identify potential rounding errors or logic flaws in their financial calculations before the code ever reaches a production environment.
By integrating mock-jutsu into your CI/CD pipeline, you automate the creation of high-quality test data that reflects the complexity of the modern global market. The taxrate function serves as a robust alias for generating localized tax information, reducing the overhead associated with maintaining complex test databases. Ultimately, this leads to more resilient software and faster development cycles, as engineers can focus on building core features while mock-jutsu handles the intricacies of commerce-related data simulation.
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 |