address_cityContactLocale Aware

Mock Jutsu HOW-TO | UK

The address_city function serves as a cornerstone within the mock-jutsu library’s contact category, providing developers with a streamlined method to generate realistic city names. When building modern applications, the requirement for high-quality mock data is paramount to ensure that user interfaces and backend logic behave as expected under real-world conditions. By invoking this function, engineers can instantly populate their environments with authentic urban identifiers, such as Istanbul, London, or Sydney, depending on the configured locale. This capability is essential for creating believable test environments that mirror the geographic diversity of a global user base.

Under the bonnet, mock-jutsu utilises comprehensive localised datasets to ensure that every address_city output aligns with regional naming conventions and geographic standards. Unlike basic random string generators, this function draws from curated databases that reflect actual major municipalities across various continents. This adherence to geographic realism allows for more rigorous validation of address-parsing logic and ensures that database schemas are tested against varied string lengths and character sets. By integrating these standards, the library provides a robust foundation for developers who need to simulate complex demographic distributions without manually sourcing geographic information.

In terms of practical application, the address_city function is invaluable across various testing scenarios. For instance, QA engineers can use it to verify the accuracy of shipping calculators in e-commerce platforms or to test the responsiveness of location-based filters in search results. It is equally effective for generating large-scale test data for performance benchmarking, allowing teams to see how their systems handle millions of unique geographic entries. Whether you are performing smoke tests on a registration form or conducting deep integration testing on a logistics platform, having access to authentic city names significantly improves the reliability and depth of your test suites.

Beyond pure functionality, mock-jutsu offers exceptional flexibility for developers through its multi-interface support. The address_city generator can be accessed via the command-line interface for quick data seeding, through the native Python API for automated scripts, or via JMeter for complex load testing. This versatility reduces the friction associated with data preparation and allows development teams to focus on core logic rather than manual data entry. By automating the production of high-fidelity test data, mock-jutsu empowers teams to deliver more resilient software while maintaining a rapid development lifecycle across different programming environments.

CLI Usage
mockjutsu generate address_city --locale TRmockjutsu generate address_city --locale DEmockjutsu bulk address_city --count 10 --locale TRmockjutsu export address_city --count 10 --format json --locale TRmockjutsu export address_city --count 10 --format csv --locale TRmockjutsu export address_city --count 10 --format sql --locale TR# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate address_city --locale TR --maskmockjutsu bulk address_city --count 5 --locale TR --mask
Python API
from mockjutsu import jutsujutsu.generate('address_city', locale='TR')jutsu.bulk('address_city', count=10, locale='TR')jutsu.template(['address_city'], count=5, locale='TR')# mask=True: regulation-compliant outputjutsu.generate('address_city', locale='TR', mask=True)jutsu.bulk('address_city', count=5, locale='TR', mask=True)
JMeter
${__mockjutsu_comm(address_city,TR)}# JMeter Function: __mockjutsu_comm# Parameter 1: address_city# Parameter 2: locale (TR/UK/US/DE/FR/RU)${__mockjutsu_comm(address_city,DE)}# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_comm(address_city,TR,mask)}
REST API
GET /generate/address_city?locale=TR# → {"type":"address_city","result":"...","status":"ok"}GET /bulk/address_city?count=10&locale=TRPOST /template {"types":["address_city"],"count":1,"locale":"TR"}# mask=true: regulation-compliant outputGET /generate/address_city?locale=TR&mask=trueGET /bulk/address_city?count=5&locale=TR&mask=true

Parameters

Parameter Values Description
--locale TR|UK|US|DE|FR|RU Region / locale for locale-aware output
--mask true | false Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…)

Other Languages