robotframework-mimesislibrary 1.0.0__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.
- robotframework_mimesislibrary-1.0.0/.github/workflows/ci.yml +73 -0
- robotframework_mimesislibrary-1.0.0/.github/workflows/publish.yml +66 -0
- robotframework_mimesislibrary-1.0.0/.gitignore +27 -0
- robotframework_mimesislibrary-1.0.0/LICENSE +21 -0
- robotframework_mimesislibrary-1.0.0/Makefile +44 -0
- robotframework_mimesislibrary-1.0.0/PKG-INFO +183 -0
- robotframework_mimesislibrary-1.0.0/README.md +127 -0
- robotframework_mimesislibrary-1.0.0/docs/index.html +387 -0
- robotframework_mimesislibrary-1.0.0/pyproject.toml +76 -0
- robotframework_mimesislibrary-1.0.0/src/MimesisLibrary/__init__.py +206 -0
- robotframework_mimesislibrary-1.0.0/src/MimesisLibrary/keywords/__init__.py +37 -0
- robotframework_mimesislibrary-1.0.0/src/MimesisLibrary/keywords/address.py +176 -0
- robotframework_mimesislibrary-1.0.0/src/MimesisLibrary/keywords/code.py +84 -0
- robotframework_mimesislibrary-1.0.0/src/MimesisLibrary/keywords/cryptographic.py +98 -0
- robotframework_mimesislibrary-1.0.0/src/MimesisLibrary/keywords/datetime_kw.py +129 -0
- robotframework_mimesislibrary-1.0.0/src/MimesisLibrary/keywords/development.py +80 -0
- robotframework_mimesislibrary-1.0.0/src/MimesisLibrary/keywords/finance.py +126 -0
- robotframework_mimesislibrary-1.0.0/src/MimesisLibrary/keywords/food.py +78 -0
- robotframework_mimesislibrary-1.0.0/src/MimesisLibrary/keywords/hardware.py +130 -0
- robotframework_mimesislibrary-1.0.0/src/MimesisLibrary/keywords/internet.py +175 -0
- robotframework_mimesislibrary-1.0.0/src/MimesisLibrary/keywords/numeric.py +106 -0
- robotframework_mimesislibrary-1.0.0/src/MimesisLibrary/keywords/path.py +70 -0
- robotframework_mimesislibrary-1.0.0/src/MimesisLibrary/keywords/payment.py +98 -0
- robotframework_mimesislibrary-1.0.0/src/MimesisLibrary/keywords/person.py +278 -0
- robotframework_mimesislibrary-1.0.0/src/MimesisLibrary/keywords/science.py +91 -0
- robotframework_mimesislibrary-1.0.0/src/MimesisLibrary/keywords/text.py +170 -0
- robotframework_mimesislibrary-1.0.0/src/MimesisLibrary/keywords/transport.py +50 -0
- robotframework_mimesislibrary-1.0.0/src/MimesisLibrary/utils.py +96 -0
- robotframework_mimesislibrary-1.0.0/src/MimesisLibrary/version.py +2 -0
- robotframework_mimesislibrary-1.0.0/tests/acceptance/mimesis_tests.robot +319 -0
- robotframework_mimesislibrary-1.0.0/tests/unit/__init__.py +1 -0
- robotframework_mimesislibrary-1.0.0/tests/unit/test_keywords.py +423 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, develop]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
name: Test on Python ${{ matrix.python-version }}
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout repository
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
22
|
+
uses: actions/setup-python@v5
|
|
23
|
+
with:
|
|
24
|
+
python-version: ${{ matrix.python-version }}
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: pip install -e ".[dev]"
|
|
28
|
+
|
|
29
|
+
- name: Lint with ruff
|
|
30
|
+
run: ruff check src/
|
|
31
|
+
|
|
32
|
+
- name: Run unit tests
|
|
33
|
+
run: pytest tests/unit/ -v --tb=short
|
|
34
|
+
|
|
35
|
+
- name: Run Robot Framework acceptance tests
|
|
36
|
+
run: |
|
|
37
|
+
mkdir -p results
|
|
38
|
+
robot --outputdir results tests/acceptance/
|
|
39
|
+
|
|
40
|
+
- name: Upload Robot Framework results
|
|
41
|
+
if: always()
|
|
42
|
+
uses: actions/upload-artifact@v4
|
|
43
|
+
with:
|
|
44
|
+
name: robot-results-py${{ matrix.python-version }}
|
|
45
|
+
path: results/
|
|
46
|
+
|
|
47
|
+
docs:
|
|
48
|
+
name: Generate keyword documentation
|
|
49
|
+
runs-on: ubuntu-latest
|
|
50
|
+
needs: test
|
|
51
|
+
|
|
52
|
+
steps:
|
|
53
|
+
- name: Checkout repository
|
|
54
|
+
uses: actions/checkout@v4
|
|
55
|
+
|
|
56
|
+
- name: Set up Python
|
|
57
|
+
uses: actions/setup-python@v5
|
|
58
|
+
with:
|
|
59
|
+
python-version: "3.12"
|
|
60
|
+
|
|
61
|
+
- name: Install package
|
|
62
|
+
run: pip install -e .
|
|
63
|
+
|
|
64
|
+
- name: Generate HTML documentation
|
|
65
|
+
run: |
|
|
66
|
+
mkdir -p docs
|
|
67
|
+
python -m robot.libdoc MimesisLibrary docs/index.html
|
|
68
|
+
|
|
69
|
+
- name: Upload documentation artifact
|
|
70
|
+
uses: actions/upload-artifact@v4
|
|
71
|
+
with:
|
|
72
|
+
name: keyword-docs
|
|
73
|
+
path: docs/index.html
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
name: Upload Python Package to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch: # Allows manual trigger from GitHub Actions tab
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
id-token: write # Required for PyPI Trusted Publishing (OIDC)
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
test:
|
|
14
|
+
name: Test on Python ${{ matrix.python-version }}
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
strategy:
|
|
17
|
+
matrix:
|
|
18
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
24
|
+
uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version: ${{ matrix.python-version }}
|
|
27
|
+
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: pip install -e ".[dev]"
|
|
30
|
+
|
|
31
|
+
- name: Run unit tests
|
|
32
|
+
run: pytest tests/unit/ -v --tb=short
|
|
33
|
+
|
|
34
|
+
- name: Run Robot Framework acceptance tests
|
|
35
|
+
run: |
|
|
36
|
+
mkdir -p results
|
|
37
|
+
robot --outputdir results tests/acceptance/
|
|
38
|
+
|
|
39
|
+
publish:
|
|
40
|
+
name: Build & Publish to PyPI
|
|
41
|
+
needs: test
|
|
42
|
+
runs-on: ubuntu-latest
|
|
43
|
+
environment:
|
|
44
|
+
name: pypi
|
|
45
|
+
url: https://pypi.org/p/robotframework-mimesislibrary
|
|
46
|
+
|
|
47
|
+
steps:
|
|
48
|
+
- uses: actions/checkout@v4
|
|
49
|
+
|
|
50
|
+
- name: Set up Python
|
|
51
|
+
uses: actions/setup-python@v5
|
|
52
|
+
with:
|
|
53
|
+
python-version: "3.12"
|
|
54
|
+
|
|
55
|
+
- name: Install build tools
|
|
56
|
+
run: |
|
|
57
|
+
python -m pip install --upgrade pip
|
|
58
|
+
pip install build
|
|
59
|
+
|
|
60
|
+
- name: Build package distribution
|
|
61
|
+
run: python -m build
|
|
62
|
+
|
|
63
|
+
- name: Publish package to PyPI
|
|
64
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
65
|
+
with:
|
|
66
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.venv/
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
dist/
|
|
6
|
+
build/
|
|
7
|
+
.pytest_cache/
|
|
8
|
+
.mypy_cache/
|
|
9
|
+
.ruff_cache/
|
|
10
|
+
*.egg
|
|
11
|
+
MANIFEST
|
|
12
|
+
tmp/
|
|
13
|
+
|
|
14
|
+
# Robot Framework outputs
|
|
15
|
+
output.xml
|
|
16
|
+
log.html
|
|
17
|
+
report.html
|
|
18
|
+
results/
|
|
19
|
+
|
|
20
|
+
# IDE
|
|
21
|
+
.idea/
|
|
22
|
+
.vscode/
|
|
23
|
+
*.swp
|
|
24
|
+
*.swo
|
|
25
|
+
|
|
26
|
+
# macOS
|
|
27
|
+
.DS_Store
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 robotframework-mimesislibrary contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
.PHONY: help venv install test lint typecheck docs clean
|
|
2
|
+
|
|
3
|
+
VENV := .venv
|
|
4
|
+
PYTHON := $(VENV)/bin/python
|
|
5
|
+
PIP := $(VENV)/bin/pip
|
|
6
|
+
PYTEST := $(VENV)/bin/pytest
|
|
7
|
+
ROBOT := $(VENV)/bin/robot
|
|
8
|
+
LIBDOC := $(PYTHON) -m robot.libdoc
|
|
9
|
+
RUFF := $(VENV)/bin/ruff
|
|
10
|
+
MYPY := $(VENV)/bin/mypy
|
|
11
|
+
|
|
12
|
+
help: ## Show available commands
|
|
13
|
+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}'
|
|
14
|
+
|
|
15
|
+
venv: ## Create the virtual environment
|
|
16
|
+
python -m venv $(VENV)
|
|
17
|
+
$(PIP) install --upgrade pip
|
|
18
|
+
|
|
19
|
+
install: venv ## Install the package with dev dependencies
|
|
20
|
+
$(PIP) install -e ".[dev]"
|
|
21
|
+
|
|
22
|
+
test: ## Run unit tests with pytest
|
|
23
|
+
$(PYTEST) tests/unit/ -v --tb=short
|
|
24
|
+
|
|
25
|
+
acceptance: ## Run Robot Framework acceptance tests
|
|
26
|
+
$(ROBOT) --outputdir results tests/acceptance/
|
|
27
|
+
|
|
28
|
+
lint: ## Lint source code with ruff
|
|
29
|
+
$(RUFF) check src/
|
|
30
|
+
|
|
31
|
+
typecheck: ## Type-check source code with mypy
|
|
32
|
+
$(MYPY) src/
|
|
33
|
+
|
|
34
|
+
docs: ## Generate HTML keyword documentation with libdoc
|
|
35
|
+
mkdir -p docs
|
|
36
|
+
$(LIBDOC) MimesisLibrary docs/index.html
|
|
37
|
+
@echo "Documentation generated at docs/index.html"
|
|
38
|
+
|
|
39
|
+
clean: ## Remove build artifacts and caches
|
|
40
|
+
rm -rf dist/ build/ *.egg-info/ .pytest_cache/ .mypy_cache/ .ruff_cache/
|
|
41
|
+
rm -rf results/ output.xml log.html report.html
|
|
42
|
+
find . -type d -name __pycache__ -exec rm -rf {} +
|
|
43
|
+
|
|
44
|
+
all: install lint typecheck test docs ## Run full pipeline
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: robotframework-mimesislibrary
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Robot Framework keyword library wrapper for the Mimesis fake data generator
|
|
5
|
+
Project-URL: Homepage, https://github.com/your-org/robotframework-mimesislibrary
|
|
6
|
+
Project-URL: Repository, https://github.com/your-org/robotframework-mimesislibrary
|
|
7
|
+
Project-URL: Bug Tracker, https://github.com/your-org/robotframework-mimesislibrary/issues
|
|
8
|
+
Project-URL: Documentation, https://your-org.github.io/robotframework-mimesislibrary/
|
|
9
|
+
Author: robotframework-mimesis contributors
|
|
10
|
+
License: MIT License
|
|
11
|
+
|
|
12
|
+
Copyright (c) 2026 robotframework-mimesislibrary contributors
|
|
13
|
+
|
|
14
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
15
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
16
|
+
in the Software without restriction, including without limitation the rights
|
|
17
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
18
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
19
|
+
furnished to do so, subject to the following conditions:
|
|
20
|
+
|
|
21
|
+
The above copyright notice and this permission notice shall be included in all
|
|
22
|
+
copies or substantial portions of the Software.
|
|
23
|
+
|
|
24
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
25
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
26
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
27
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
28
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
29
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
30
|
+
SOFTWARE.
|
|
31
|
+
License-File: LICENSE
|
|
32
|
+
Keywords: data,fake,keywords,mimesis,robotframework,synthetic,testing
|
|
33
|
+
Classifier: Development Status :: 4 - Beta
|
|
34
|
+
Classifier: Framework :: Robot Framework
|
|
35
|
+
Classifier: Framework :: Robot Framework :: Library
|
|
36
|
+
Classifier: Intended Audience :: Developers
|
|
37
|
+
Classifier: Intended Audience :: Information Technology
|
|
38
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
39
|
+
Classifier: Operating System :: OS Independent
|
|
40
|
+
Classifier: Programming Language :: Python :: 3
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
42
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
43
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
44
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
45
|
+
Classifier: Topic :: Software Development :: Testing
|
|
46
|
+
Requires-Python: >=3.10
|
|
47
|
+
Requires-Dist: mimesis>=18.0
|
|
48
|
+
Requires-Dist: robotframework>=5.0
|
|
49
|
+
Provides-Extra: dev
|
|
50
|
+
Requires-Dist: docutils>=0.20; extra == 'dev'
|
|
51
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
52
|
+
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
|
|
53
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
54
|
+
Requires-Dist: ruff>=0.5; extra == 'dev'
|
|
55
|
+
Description-Content-Type: text/markdown
|
|
56
|
+
|
|
57
|
+
# robotframework-mimesislibrary
|
|
58
|
+
|
|
59
|
+
A [Robot Framework](https://robotframework.org/) keyword library that wraps the [Mimesis](https://mimesis.name/) fake data generator, providing over 100 keywords to generate synthetic data directly in your test suites.
|
|
60
|
+
|
|
61
|
+
## Installation
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
pip install robotframework-mimesislibrary
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Quick Start
|
|
68
|
+
|
|
69
|
+
```robotframework
|
|
70
|
+
*** Settings ***
|
|
71
|
+
Library MimesisLibrary
|
|
72
|
+
|
|
73
|
+
*** Test Cases ***
|
|
74
|
+
Generate Person Data
|
|
75
|
+
${name}= Fake Full Name
|
|
76
|
+
${email}= Fake Email
|
|
77
|
+
${phone}= Fake Phone Number
|
|
78
|
+
Log Many ${name} ${email} ${phone}
|
|
79
|
+
|
|
80
|
+
Use Per-Keyword Locale
|
|
81
|
+
${arabic_name}= Fake First Name locale=AR
|
|
82
|
+
${french_city}= Fake City locale=FR
|
|
83
|
+
${turkish_name}= Fake Full Name locale=TR
|
|
84
|
+
Log Many ${arabic_name} ${french_city} ${turkish_name}
|
|
85
|
+
|
|
86
|
+
Generate Internet Data
|
|
87
|
+
${ip}= Fake IPv4
|
|
88
|
+
${url}= Fake URL
|
|
89
|
+
${mac}= Fake MAC Address
|
|
90
|
+
Log Many ${ip} ${url} ${mac}
|
|
91
|
+
|
|
92
|
+
Generate Unique ID
|
|
93
|
+
${uuid}= Fake UUID
|
|
94
|
+
${token}= Fake Token Hex
|
|
95
|
+
Log Many ${uuid} ${token}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Import Options
|
|
99
|
+
|
|
100
|
+
```robotframework
|
|
101
|
+
# Use default locale (English)
|
|
102
|
+
Library MimesisLibrary
|
|
103
|
+
|
|
104
|
+
# Use a specific default locale
|
|
105
|
+
Library MimesisLibrary locale=TR
|
|
106
|
+
|
|
107
|
+
# Use with a fixed seed for reproducible data
|
|
108
|
+
Library MimesisLibrary locale=EN seed=42
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Keyword Categories
|
|
112
|
+
|
|
113
|
+
| Category | Example Keywords |
|
|
114
|
+
|----------|-----------------|
|
|
115
|
+
| **Person** | `Fake First Name`, `Fake Full Name`, `Fake Email`, `Fake Password` |
|
|
116
|
+
| **Address** | `Fake City`, `Fake Country`, `Fake Street Name`, `Fake Zip Code` |
|
|
117
|
+
| **Internet** | `Fake IPv4`, `Fake URL`, `Fake MAC Address`, `Fake User Agent` |
|
|
118
|
+
| **Code** | `Fake EAN`, `Fake IMEI`, `Fake ISBN`, `Fake UUID` |
|
|
119
|
+
| **Cryptographic** | `Fake UUID`, `Fake Token Hex`, `Fake MD5`, `Fake SHA256` |
|
|
120
|
+
| **Datetime** | `Fake Date`, `Fake Time`, `Fake Datetime`, `Fake Timezone` |
|
|
121
|
+
| **Finance** | `Fake Bank Account`, `Fake Currency Code`, `Fake Cryptocurrency` |
|
|
122
|
+
| **Payment** | `Fake Credit Card Number`, `Fake CVV` |
|
|
123
|
+
| **Food** | `Fake Dish`, `Fake Drink`, `Fake Fruit`, `Fake Vegetable` |
|
|
124
|
+
| **Text** | `Fake Word`, `Fake Sentence`, `Fake Color`, `Fake Quote` |
|
|
125
|
+
| **Numeric** | `Fake Integer`, `Fake Float` |
|
|
126
|
+
| **Hardware** | `Fake CPU`, `Fake GPU`, `Fake RAM Size` |
|
|
127
|
+
| **Transport** | `Fake Car`, `Fake VIN`, `Fake Airplane` |
|
|
128
|
+
| **Development** | `Fake Programming Language`, `Fake OS`, `Fake License` |
|
|
129
|
+
| **Science** | `Fake Chemical Element`, `Fake Measure Unit` |
|
|
130
|
+
| **Path** | `Fake Root Path`, `Fake Project Dir` |
|
|
131
|
+
|
|
132
|
+
## Supported Locales
|
|
133
|
+
|
|
134
|
+
Mimesis supports 30+ locales. Locale-dependent keywords (Person, Address, Food, Text, Finance, Datetime) accept a `locale` parameter:
|
|
135
|
+
|
|
136
|
+
```robotframework
|
|
137
|
+
${name}= Fake First Name locale=TR # Turkish
|
|
138
|
+
${name}= Fake First Name locale=AR # Arabic
|
|
139
|
+
${name}= Fake First Name locale=JA # Japanese
|
|
140
|
+
${name}= Fake First Name locale=DE # German
|
|
141
|
+
${name}= Fake First Name locale=FR # French
|
|
142
|
+
${name}= Fake First Name locale=RU # Russian
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Locale-independent keywords (`Fake UUID`, `Fake IPv4`, `Fake Integer`, etc.) ignore the `locale` parameter.
|
|
146
|
+
|
|
147
|
+
## Reproducible Data with Seeds
|
|
148
|
+
|
|
149
|
+
```robotframework
|
|
150
|
+
Library MimesisLibrary seed=42
|
|
151
|
+
|
|
152
|
+
*** Test Cases ***
|
|
153
|
+
Reproducible Test
|
|
154
|
+
${name}= Fake First Name # Always returns the same value
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## HTML Documentation
|
|
158
|
+
|
|
159
|
+
Generate the full keyword reference in HTML format:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
python -m robot.libdoc MimesisLibrary docs/index.html
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Development Setup
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
git clone https://github.com/your-org/robotframework-mimesislibrary
|
|
169
|
+
cd robotframework-mimesislibrary
|
|
170
|
+
python -m venv .venv
|
|
171
|
+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
|
|
172
|
+
pip install -e ".[dev]"
|
|
173
|
+
|
|
174
|
+
# Run tests
|
|
175
|
+
make test
|
|
176
|
+
|
|
177
|
+
# Generate docs
|
|
178
|
+
make docs
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## License
|
|
182
|
+
|
|
183
|
+
MIT License — see [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# robotframework-mimesislibrary
|
|
2
|
+
|
|
3
|
+
A [Robot Framework](https://robotframework.org/) keyword library that wraps the [Mimesis](https://mimesis.name/) fake data generator, providing over 100 keywords to generate synthetic data directly in your test suites.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install robotframework-mimesislibrary
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```robotframework
|
|
14
|
+
*** Settings ***
|
|
15
|
+
Library MimesisLibrary
|
|
16
|
+
|
|
17
|
+
*** Test Cases ***
|
|
18
|
+
Generate Person Data
|
|
19
|
+
${name}= Fake Full Name
|
|
20
|
+
${email}= Fake Email
|
|
21
|
+
${phone}= Fake Phone Number
|
|
22
|
+
Log Many ${name} ${email} ${phone}
|
|
23
|
+
|
|
24
|
+
Use Per-Keyword Locale
|
|
25
|
+
${arabic_name}= Fake First Name locale=AR
|
|
26
|
+
${french_city}= Fake City locale=FR
|
|
27
|
+
${turkish_name}= Fake Full Name locale=TR
|
|
28
|
+
Log Many ${arabic_name} ${french_city} ${turkish_name}
|
|
29
|
+
|
|
30
|
+
Generate Internet Data
|
|
31
|
+
${ip}= Fake IPv4
|
|
32
|
+
${url}= Fake URL
|
|
33
|
+
${mac}= Fake MAC Address
|
|
34
|
+
Log Many ${ip} ${url} ${mac}
|
|
35
|
+
|
|
36
|
+
Generate Unique ID
|
|
37
|
+
${uuid}= Fake UUID
|
|
38
|
+
${token}= Fake Token Hex
|
|
39
|
+
Log Many ${uuid} ${token}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Import Options
|
|
43
|
+
|
|
44
|
+
```robotframework
|
|
45
|
+
# Use default locale (English)
|
|
46
|
+
Library MimesisLibrary
|
|
47
|
+
|
|
48
|
+
# Use a specific default locale
|
|
49
|
+
Library MimesisLibrary locale=TR
|
|
50
|
+
|
|
51
|
+
# Use with a fixed seed for reproducible data
|
|
52
|
+
Library MimesisLibrary locale=EN seed=42
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Keyword Categories
|
|
56
|
+
|
|
57
|
+
| Category | Example Keywords |
|
|
58
|
+
|----------|-----------------|
|
|
59
|
+
| **Person** | `Fake First Name`, `Fake Full Name`, `Fake Email`, `Fake Password` |
|
|
60
|
+
| **Address** | `Fake City`, `Fake Country`, `Fake Street Name`, `Fake Zip Code` |
|
|
61
|
+
| **Internet** | `Fake IPv4`, `Fake URL`, `Fake MAC Address`, `Fake User Agent` |
|
|
62
|
+
| **Code** | `Fake EAN`, `Fake IMEI`, `Fake ISBN`, `Fake UUID` |
|
|
63
|
+
| **Cryptographic** | `Fake UUID`, `Fake Token Hex`, `Fake MD5`, `Fake SHA256` |
|
|
64
|
+
| **Datetime** | `Fake Date`, `Fake Time`, `Fake Datetime`, `Fake Timezone` |
|
|
65
|
+
| **Finance** | `Fake Bank Account`, `Fake Currency Code`, `Fake Cryptocurrency` |
|
|
66
|
+
| **Payment** | `Fake Credit Card Number`, `Fake CVV` |
|
|
67
|
+
| **Food** | `Fake Dish`, `Fake Drink`, `Fake Fruit`, `Fake Vegetable` |
|
|
68
|
+
| **Text** | `Fake Word`, `Fake Sentence`, `Fake Color`, `Fake Quote` |
|
|
69
|
+
| **Numeric** | `Fake Integer`, `Fake Float` |
|
|
70
|
+
| **Hardware** | `Fake CPU`, `Fake GPU`, `Fake RAM Size` |
|
|
71
|
+
| **Transport** | `Fake Car`, `Fake VIN`, `Fake Airplane` |
|
|
72
|
+
| **Development** | `Fake Programming Language`, `Fake OS`, `Fake License` |
|
|
73
|
+
| **Science** | `Fake Chemical Element`, `Fake Measure Unit` |
|
|
74
|
+
| **Path** | `Fake Root Path`, `Fake Project Dir` |
|
|
75
|
+
|
|
76
|
+
## Supported Locales
|
|
77
|
+
|
|
78
|
+
Mimesis supports 30+ locales. Locale-dependent keywords (Person, Address, Food, Text, Finance, Datetime) accept a `locale` parameter:
|
|
79
|
+
|
|
80
|
+
```robotframework
|
|
81
|
+
${name}= Fake First Name locale=TR # Turkish
|
|
82
|
+
${name}= Fake First Name locale=AR # Arabic
|
|
83
|
+
${name}= Fake First Name locale=JA # Japanese
|
|
84
|
+
${name}= Fake First Name locale=DE # German
|
|
85
|
+
${name}= Fake First Name locale=FR # French
|
|
86
|
+
${name}= Fake First Name locale=RU # Russian
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Locale-independent keywords (`Fake UUID`, `Fake IPv4`, `Fake Integer`, etc.) ignore the `locale` parameter.
|
|
90
|
+
|
|
91
|
+
## Reproducible Data with Seeds
|
|
92
|
+
|
|
93
|
+
```robotframework
|
|
94
|
+
Library MimesisLibrary seed=42
|
|
95
|
+
|
|
96
|
+
*** Test Cases ***
|
|
97
|
+
Reproducible Test
|
|
98
|
+
${name}= Fake First Name # Always returns the same value
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## HTML Documentation
|
|
102
|
+
|
|
103
|
+
Generate the full keyword reference in HTML format:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
python -m robot.libdoc MimesisLibrary docs/index.html
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Development Setup
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
git clone https://github.com/your-org/robotframework-mimesislibrary
|
|
113
|
+
cd robotframework-mimesislibrary
|
|
114
|
+
python -m venv .venv
|
|
115
|
+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
|
|
116
|
+
pip install -e ".[dev]"
|
|
117
|
+
|
|
118
|
+
# Run tests
|
|
119
|
+
make test
|
|
120
|
+
|
|
121
|
+
# Generate docs
|
|
122
|
+
make docs
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## License
|
|
126
|
+
|
|
127
|
+
MIT License — see [LICENSE](LICENSE) for details.
|