behave-data 0.1.2__tar.gz → 0.1.4__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.
- behave_data-0.1.4/.github/workflows/docs.yml +53 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/CHANGELOG.md +33 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/PKG-INFO +14 -1
- {behave_data-0.1.2 → behave_data-0.1.4}/behave_data/__init__.py +1 -1
- {behave_data-0.1.2 → behave_data-0.1.4}/behave_data/tags.py +11 -6
- behave_data-0.1.4/docs/_build/html/.buildinfo +4 -0
- behave_data-0.1.4/docs/_build/html/.buildinfo.bak +4 -0
- behave_data-0.1.4/docs/_build/html/.doctrees/__intersphinx_cache__/behave_objects.inv +0 -0
- behave_data-0.1.4/docs/_build/html/.doctrees/__intersphinx_cache__/python_objects.inv +0 -0
- behave_data-0.1.4/docs/_build/html/.doctrees/api.doctree +0 -0
- behave_data-0.1.4/docs/_build/html/.doctrees/builders.doctree +0 -0
- behave_data-0.1.4/docs/_build/html/.doctrees/changelog.doctree +0 -0
- behave_data-0.1.4/docs/_build/html/.doctrees/configuration.doctree +0 -0
- behave_data-0.1.4/docs/_build/html/.doctrees/diff.doctree +0 -0
- behave_data-0.1.4/docs/_build/html/.doctrees/dynamic_examples.doctree +0 -0
- behave_data-0.1.4/docs/_build/html/.doctrees/environment.pickle +0 -0
- behave_data-0.1.4/docs/_build/html/.doctrees/fixtures.doctree +0 -0
- behave_data-0.1.4/docs/_build/html/.doctrees/hooks.doctree +0 -0
- behave_data-0.1.4/docs/_build/html/.doctrees/index.doctree +0 -0
- behave_data-0.1.4/docs/_build/html/.doctrees/installation.doctree +0 -0
- behave_data-0.1.4/docs/_build/html/.doctrees/migration.doctree +0 -0
- behave_data-0.1.4/docs/_build/html/.doctrees/null_handling.doctree +0 -0
- behave_data-0.1.4/docs/_build/html/.doctrees/quickstart.doctree +0 -0
- behave_data-0.1.4/docs/_build/html/.doctrees/raw_tables.doctree +0 -0
- behave_data-0.1.4/docs/_build/html/.doctrees/secrets.doctree +0 -0
- behave_data-0.1.4/docs/_build/html/.doctrees/tags.doctree +0 -0
- behave_data-0.1.4/docs/_build/html/.doctrees/typed_tables.doctree +0 -0
- behave_data-0.1.4/docs/_build/html/_images/logo.svg +7 -0
- behave_data-0.1.4/docs/_build/html/_sources/api.md.txt +165 -0
- behave_data-0.1.4/docs/_build/html/_sources/builders.md.txt +82 -0
- behave_data-0.1.4/docs/_build/html/_sources/changelog.md.txt +4 -0
- behave_data-0.1.4/docs/_build/html/_sources/configuration.md.txt +81 -0
- behave_data-0.1.4/docs/_build/html/_sources/diff.md.txt +115 -0
- behave_data-0.1.4/docs/_build/html/_sources/dynamic_examples.md.txt +113 -0
- behave_data-0.1.4/docs/_build/html/_sources/fixtures.md.txt +132 -0
- behave_data-0.1.4/docs/_build/html/_sources/hooks.md.txt +104 -0
- behave_data-0.1.4/docs/_build/html/_sources/index.md.txt +131 -0
- behave_data-0.1.4/docs/_build/html/_sources/installation.md.txt +57 -0
- behave_data-0.1.4/docs/_build/html/_sources/migration.md.txt +118 -0
- behave_data-0.1.4/docs/_build/html/_sources/null_handling.md.txt +82 -0
- behave_data-0.1.4/docs/_build/html/_sources/quickstart.md.txt +122 -0
- behave_data-0.1.4/docs/_build/html/_sources/raw_tables.md.txt +69 -0
- behave_data-0.1.4/docs/_build/html/_sources/secrets.md.txt +120 -0
- behave_data-0.1.4/docs/_build/html/_sources/tags.md.txt +109 -0
- behave_data-0.1.4/docs/_build/html/_sources/typed_tables.md.txt +149 -0
- behave_data-0.1.4/docs/_build/html/_static/base-stemmer.js +476 -0
- behave_data-0.1.4/docs/_build/html/_static/basic.css +906 -0
- behave_data-0.1.4/docs/_build/html/_static/debug.css +69 -0
- behave_data-0.1.4/docs/_build/html/_static/doctools.js +150 -0
- behave_data-0.1.4/docs/_build/html/_static/documentation_options.js +13 -0
- behave_data-0.1.4/docs/_build/html/_static/english-stemmer.js +1066 -0
- behave_data-0.1.4/docs/_build/html/_static/favicon.svg +7 -0
- behave_data-0.1.4/docs/_build/html/_static/file.png +0 -0
- behave_data-0.1.4/docs/_build/html/_static/language_data.js +13 -0
- behave_data-0.1.4/docs/_build/html/_static/logo.svg +7 -0
- behave_data-0.1.4/docs/_build/html/_static/minus.png +0 -0
- behave_data-0.1.4/docs/_build/html/_static/plus.png +0 -0
- behave_data-0.1.4/docs/_build/html/_static/pygments.css +250 -0
- behave_data-0.1.4/docs/_build/html/_static/scripts/furo-extensions.js +0 -0
- behave_data-0.1.4/docs/_build/html/_static/scripts/furo.js +3 -0
- behave_data-0.1.4/docs/_build/html/_static/scripts/furo.js.LICENSE.txt +7 -0
- behave_data-0.1.4/docs/_build/html/_static/scripts/furo.js.map +1 -0
- behave_data-0.1.4/docs/_build/html/_static/searchtools.js +693 -0
- behave_data-0.1.4/docs/_build/html/_static/skeleton.css +296 -0
- behave_data-0.1.4/docs/_build/html/_static/sphinx_highlight.js +159 -0
- behave_data-0.1.4/docs/_build/html/_static/styles/furo-extensions.css +2 -0
- behave_data-0.1.4/docs/_build/html/_static/styles/furo-extensions.css.map +1 -0
- behave_data-0.1.4/docs/_build/html/_static/styles/furo.css +2 -0
- behave_data-0.1.4/docs/_build/html/_static/styles/furo.css.map +1 -0
- behave_data-0.1.4/docs/_build/html/api.html +507 -0
- behave_data-0.1.4/docs/_build/html/builders.html +415 -0
- behave_data-0.1.4/docs/_build/html/changelog.html +402 -0
- behave_data-0.1.4/docs/_build/html/configuration.html +440 -0
- behave_data-0.1.4/docs/_build/html/diff.html +446 -0
- behave_data-0.1.4/docs/_build/html/dynamic_examples.html +470 -0
- behave_data-0.1.4/docs/_build/html/fixtures.html +460 -0
- behave_data-0.1.4/docs/_build/html/genindex.html +288 -0
- behave_data-0.1.4/docs/_build/html/hooks.html +434 -0
- behave_data-0.1.4/docs/_build/html/index.html +566 -0
- behave_data-0.1.4/docs/_build/html/installation.html +433 -0
- behave_data-0.1.4/docs/_build/html/migration.html +438 -0
- behave_data-0.1.4/docs/_build/html/null_handling.html +412 -0
- behave_data-0.1.4/docs/_build/html/objects.inv +8 -0
- behave_data-0.1.4/docs/_build/html/quickstart.html +453 -0
- behave_data-0.1.4/docs/_build/html/raw_tables.html +400 -0
- behave_data-0.1.4/docs/_build/html/search.html +299 -0
- behave_data-0.1.4/docs/_build/html/searchindex.js +1 -0
- behave_data-0.1.4/docs/_build/html/secrets.html +478 -0
- behave_data-0.1.4/docs/_build/html/tags.html +436 -0
- behave_data-0.1.4/docs/_build/html/typed_tables.html +502 -0
- behave_data-0.1.4/docs/_static/favicon.svg +7 -0
- behave_data-0.1.4/docs/_static/logo.svg +7 -0
- behave_data-0.1.4/docs/api.md +165 -0
- behave_data-0.1.4/docs/builders.md +82 -0
- behave_data-0.1.4/docs/changelog.md +4 -0
- behave_data-0.1.4/docs/conf.py +67 -0
- behave_data-0.1.4/docs/configuration.md +81 -0
- behave_data-0.1.4/docs/diff.md +115 -0
- behave_data-0.1.4/docs/dynamic_examples.md +113 -0
- behave_data-0.1.4/docs/fixtures.md +132 -0
- behave_data-0.1.4/docs/hooks.md +104 -0
- behave_data-0.1.4/docs/index.md +131 -0
- behave_data-0.1.4/docs/installation.md +57 -0
- behave_data-0.1.4/docs/migration.md +118 -0
- behave_data-0.1.4/docs/null_handling.md +82 -0
- behave_data-0.1.4/docs/quickstart.md +122 -0
- behave_data-0.1.4/docs/raw_tables.md +69 -0
- behave_data-0.1.4/docs/secrets.md +120 -0
- behave_data-0.1.4/docs/tags.md +109 -0
- behave_data-0.1.4/docs/typed_tables.md +149 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/pyproject.toml +16 -1
- behave_data-0.1.4/tests/integration/environment.py +48 -0
- behave_data-0.1.4/tests/integration/features/data/products.json +5 -0
- behave_data-0.1.4/tests/integration/features/data/users.csv +4 -0
- behave_data-0.1.4/tests/integration/features/dynamic_examples.feature +19 -0
- behave_data-0.1.4/tests/integration/features/fixtures_builders.feature +34 -0
- behave_data-0.1.4/tests/integration/features/secrets.feature +19 -0
- behave_data-0.1.4/tests/integration/features/typed_table_edge.feature +37 -0
- behave_data-0.1.4/tests/integration/steps/e2e_steps.py +247 -0
- behave_data-0.1.4/tests/unit/test_edge_cases.py +613 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/tests/unit/test_patch.py +6 -1
- behave_data-0.1.2/tests/integration/environment.py +0 -14
- {behave_data-0.1.2 → behave_data-0.1.4}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/.github/workflows/ci.yml +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/.github/workflows/release.yml +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/.gitignore +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/.pre-commit-config.yaml +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/CODE_OF_CONDUCT.md +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/CONTRIBUTING.md +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/LICENSE +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/Makefile +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/README.md +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/SECURITY.md +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/behave_data/builders.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/behave_data/config.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/behave_data/diff.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/behave_data/errors.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/behave_data/examples.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/behave_data/fixtures.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/behave_data/hooks.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/behave_data/loaders/__init__.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/behave_data/loaders/csv.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/behave_data/loaders/excel.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/behave_data/loaders/http.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/behave_data/loaders/json.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/behave_data/loaders/sql.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/behave_data/loaders/yaml.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/behave_data/manager.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/behave_data/null.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/behave_data/patch.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/behave_data/py.typed +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/behave_data/raw_table.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/behave_data/secrets.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/behave_data/typed_table.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/behave_data/types.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/tests/conftest.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/tests/integration/features/data_tables.feature +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/tests/integration/features/diff.feature +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/tests/integration/features/null_handling.feature +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/tests/integration/features/nullable_types.feature +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/tests/integration/features/raw_table.feature +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/tests/integration/features/typing.feature +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/tests/integration/steps/data_tables_steps.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/tests/integration/test_integration.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/tests/unit/test_builders.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/tests/unit/test_config.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/tests/unit/test_diff.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/tests/unit/test_errors.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/tests/unit/test_examples.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/tests/unit/test_fixtures.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/tests/unit/test_hooks.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/tests/unit/test_loaders.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/tests/unit/test_manager.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/tests/unit/test_null.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/tests/unit/test_raw_table.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/tests/unit/test_secrets.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/tests/unit/test_tags.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/tests/unit/test_typed_table.py +0 -0
- {behave_data-0.1.2 → behave_data-0.1.4}/tests/unit/test_types.py +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
name: Docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
tags: ["v*"]
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
pages: write
|
|
12
|
+
id-token: write
|
|
13
|
+
|
|
14
|
+
concurrency:
|
|
15
|
+
group: pages
|
|
16
|
+
cancel-in-progress: false
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
build:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- name: Checkout
|
|
23
|
+
uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
- name: Setup Python
|
|
26
|
+
uses: actions/setup-python@v5
|
|
27
|
+
with:
|
|
28
|
+
python-version: "3.12"
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: |
|
|
32
|
+
python -m pip install --upgrade pip
|
|
33
|
+
pip install -e ".[docs,all]"
|
|
34
|
+
|
|
35
|
+
- name: Build Sphinx docs
|
|
36
|
+
run: |
|
|
37
|
+
sphinx-build -W -b html docs docs/_build/html
|
|
38
|
+
|
|
39
|
+
- name: Upload artifact
|
|
40
|
+
uses: actions/upload-pages-artifact@v3
|
|
41
|
+
with:
|
|
42
|
+
path: docs/_build/html
|
|
43
|
+
|
|
44
|
+
deploy:
|
|
45
|
+
needs: build
|
|
46
|
+
runs-on: ubuntu-latest
|
|
47
|
+
environment:
|
|
48
|
+
name: github-pages
|
|
49
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
50
|
+
steps:
|
|
51
|
+
- name: Deploy to GitHub Pages
|
|
52
|
+
id: deployment
|
|
53
|
+
uses: actions/deploy-pages@v4
|
|
@@ -5,6 +5,39 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.1.4] - 2026-07-17
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Sphinx documentation site with furo theme
|
|
13
|
+
- 13 documentation pages: quickstart, installation, typed tables, null handling, diff, raw tables, dynamic examples, fixtures, builders, secrets, tags, hooks, configuration, API reference, migration guide, changelog
|
|
14
|
+
- GitHub Actions workflow `docs.yml` to build and deploy docs to GitHub Pages
|
|
15
|
+
- Documentation URL in `pyproject.toml`
|
|
16
|
+
- `docs` and `all` optional dependency extras
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- `test_to_pandas_raises_without_pandas` now uses `monkeypatch` on `sys.modules["pandas"]` for robustness when `pandas` extra is installed
|
|
21
|
+
|
|
22
|
+
## [0.1.3] - 2026-07-17
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- 75 edge case unit tests covering hooks, secrets, examples, raw_table, yaml, types, diff, fixtures, loaders, config, and manager
|
|
27
|
+
- 4 new E2E Behave integration features: fixtures_builders, secrets, typed_table_edge, dynamic_examples
|
|
28
|
+
- 27 E2E scenarios with 64 steps testing all behave-data features in real Behave
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- `tags.py` now strips `@` prefix from Behave tags (Behave strips `@` from scenario tags)
|
|
33
|
+
- `tags.py` `@needs_data` now sets attribute on context in addition to `_behave_data_loaded`
|
|
34
|
+
- `tags.py` cleanup functions now support both `func(context)` and `func()` signatures
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
|
|
38
|
+
- Coverage increased from 94% to 98%
|
|
39
|
+
- Total tests: 411 passed, 1 skipped (pandas optional)
|
|
40
|
+
|
|
8
41
|
## [0.1.2] - 2026-07-17
|
|
9
42
|
|
|
10
43
|
### Fixed
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: behave-data
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: Data management for Behave — typed tables, diff, dynamic examples, fixtures, secrets
|
|
5
5
|
Project-URL: Homepage, https://github.com/MathiasPaulenko/behave-data
|
|
6
|
+
Project-URL: Documentation, https://mathiaspaulenko.github.io/behave-data
|
|
6
7
|
Project-URL: Repository, https://github.com/MathiasPaulenko/behave-data
|
|
7
8
|
Project-URL: Issues, https://github.com/MathiasPaulenko/behave-data/issues
|
|
8
9
|
Project-URL: Changelog, https://github.com/MathiasPaulenko/behave-data/blob/main/CHANGELOG.md
|
|
@@ -23,6 +24,14 @@ Classifier: Typing :: Typed
|
|
|
23
24
|
Requires-Python: >=3.11
|
|
24
25
|
Requires-Dist: behave-tables>=1.3.0
|
|
25
26
|
Requires-Dist: behave>=1.2.6
|
|
27
|
+
Provides-Extra: all
|
|
28
|
+
Requires-Dist: boto3>=1.34; extra == 'all'
|
|
29
|
+
Requires-Dist: hvac>=2.0; extra == 'all'
|
|
30
|
+
Requires-Dist: openpyxl>=3.1; extra == 'all'
|
|
31
|
+
Requires-Dist: pandas>=2.0; extra == 'all'
|
|
32
|
+
Requires-Dist: pyyaml>=6.0; extra == 'all'
|
|
33
|
+
Requires-Dist: requests>=2.31; extra == 'all'
|
|
34
|
+
Requires-Dist: sqlalchemy>=2.0; extra == 'all'
|
|
26
35
|
Provides-Extra: aws
|
|
27
36
|
Requires-Dist: boto3>=1.34; extra == 'aws'
|
|
28
37
|
Provides-Extra: dev
|
|
@@ -31,6 +40,10 @@ Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
|
31
40
|
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
|
|
32
41
|
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
33
42
|
Requires-Dist: ruff>=0.5; extra == 'dev'
|
|
43
|
+
Provides-Extra: docs
|
|
44
|
+
Requires-Dist: furo>=2024.0; extra == 'docs'
|
|
45
|
+
Requires-Dist: myst-parser>=3.0; extra == 'docs'
|
|
46
|
+
Requires-Dist: sphinx>=7.0; extra == 'docs'
|
|
34
47
|
Provides-Extra: excel
|
|
35
48
|
Requires-Dist: openpyxl>=3.1; extra == 'excel'
|
|
36
49
|
Provides-Extra: pandas
|
|
@@ -38,7 +38,7 @@ from behave_data.tags import process_tags_after_scenario, process_tags_before_sc
|
|
|
38
38
|
from behave_data.typed_table import TypedTableWrapper, typed_wrap
|
|
39
39
|
from behave_data.types import TYPE_CONVERTERS, convert_cell, parse_column_header, register_type
|
|
40
40
|
|
|
41
|
-
__version__ = "0.1.
|
|
41
|
+
__version__ = "0.1.4"
|
|
42
42
|
|
|
43
43
|
__all__ = [
|
|
44
44
|
"BehaveDataError",
|
|
@@ -29,15 +29,17 @@ def process_tags_before_scenario(context: Any, scenario: Any) -> None:
|
|
|
29
29
|
context._behave_data_loaded = {}
|
|
30
30
|
|
|
31
31
|
for tag in tags:
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
tag = tag.lstrip("@")
|
|
33
|
+
if tag.startswith("needs_data:"):
|
|
34
|
+
name = tag[len("needs_data:") :]
|
|
34
35
|
data = context.data.fixture(name)
|
|
35
36
|
context._behave_data_loaded[name] = data
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
setattr(context, name, data)
|
|
38
|
+
elif tag.startswith("with_fixture:"):
|
|
39
|
+
name = tag[len("with_fixture:") :]
|
|
38
40
|
data = context.data.fixture(name)
|
|
39
41
|
setattr(context, name, data)
|
|
40
|
-
elif tag == "
|
|
42
|
+
elif tag == "cleanup_after":
|
|
41
43
|
context._behave_data_cleanup = True
|
|
42
44
|
if not hasattr(context, "_behave_data_cleanup_funcs"):
|
|
43
45
|
context._behave_data_cleanup_funcs = []
|
|
@@ -58,6 +60,9 @@ def process_tags_after_scenario(context: Any, scenario: Any) -> None:
|
|
|
58
60
|
|
|
59
61
|
funcs = getattr(context, "_behave_data_cleanup_funcs", [])
|
|
60
62
|
for func in funcs:
|
|
61
|
-
|
|
63
|
+
try:
|
|
64
|
+
func(context)
|
|
65
|
+
except TypeError:
|
|
66
|
+
func()
|
|
62
67
|
|
|
63
68
|
context._behave_data_cleanup = False
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="100" height="100">
|
|
2
|
+
<rect width="100" height="100" rx="20" fill="#2563eb"/>
|
|
3
|
+
<rect x="20" y="25" width="60" height="8" rx="2" fill="white"/>
|
|
4
|
+
<rect x="20" y="42" width="60" height="8" rx="2" fill="white"/>
|
|
5
|
+
<rect x="20" y="59" width="40" height="8" rx="2" fill="white"/>
|
|
6
|
+
<circle cx="75" cy="63" r="8" fill="#fbbf24"/>
|
|
7
|
+
</svg>
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# API Reference
|
|
2
|
+
|
|
3
|
+
## typed_wrap
|
|
4
|
+
|
|
5
|
+
```python
|
|
6
|
+
from behave_data import typed_wrap
|
|
7
|
+
|
|
8
|
+
typed_wrap(table, config=None)
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Wraps a Behave `Table` in `TypedTableWrapper`.
|
|
12
|
+
|
|
13
|
+
- `table`: a `behave.model.Table` or any `TableLike` object.
|
|
14
|
+
- `config`: optional `Config` instance.
|
|
15
|
+
|
|
16
|
+
Returns a `TypedTableWrapper`.
|
|
17
|
+
|
|
18
|
+
## raw_table
|
|
19
|
+
|
|
20
|
+
```python
|
|
21
|
+
from behave_data import raw_table
|
|
22
|
+
|
|
23
|
+
raw_table(table)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Wraps a table in `RawTable` for header-included access.
|
|
27
|
+
|
|
28
|
+
## TypedTableWrapper
|
|
29
|
+
|
|
30
|
+
```python
|
|
31
|
+
from behave_data import TypedTableWrapper
|
|
32
|
+
|
|
33
|
+
wrapper = TypedTableWrapper(table, config)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Methods:
|
|
37
|
+
|
|
38
|
+
- `typed_dicts()` → `list[dict[str, Any]]`
|
|
39
|
+
- `typed_objects(cls)` → `list[T]`
|
|
40
|
+
- `clean_headers()` → `list[str]`
|
|
41
|
+
- All `behave-tables` `TableWrapper` methods.
|
|
42
|
+
|
|
43
|
+
## DataManager
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
from behave_data import DataManager, Config
|
|
47
|
+
|
|
48
|
+
dm = DataManager(Config())
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### fixture
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
dm.fixture(name, **overrides)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Get fixture data with optional overrides.
|
|
58
|
+
|
|
59
|
+
### build
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
dm.build(name, count=1, overrides=None)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Build data. Returns a list if `count > 1`, otherwise a single dict.
|
|
66
|
+
|
|
67
|
+
### resolve
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
dm.resolve(value)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Resolve a placeholder string. Non-string values pass through.
|
|
74
|
+
|
|
75
|
+
### mask
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
dm.mask(value)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Return `"***"` if `value` is a resolved secret, else original value.
|
|
82
|
+
|
|
83
|
+
## FixtureRegistry
|
|
84
|
+
|
|
85
|
+
```python
|
|
86
|
+
from behave_data import FixtureRegistry, data_fixture
|
|
87
|
+
|
|
88
|
+
registry = FixtureRegistry()
|
|
89
|
+
registry.register("user", lambda: {"name": "Alice"})
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
`@data_fixture(name, scope="scenario", params=None)` decorator registers a fixture in the global registry.
|
|
93
|
+
|
|
94
|
+
## BuilderRegistry
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
from behave_data import BuilderRegistry, data_builder
|
|
98
|
+
|
|
99
|
+
registry = BuilderRegistry()
|
|
100
|
+
registry.register("product", lambda o: {"name": "Widget", **o})
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
`@data_builder(name)` decorator registers a builder.
|
|
104
|
+
|
|
105
|
+
## Config
|
|
106
|
+
|
|
107
|
+
```python
|
|
108
|
+
from behave_data import Config
|
|
109
|
+
|
|
110
|
+
config = Config()
|
|
111
|
+
config = Config.from_file("behave_data.yml")
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## diff
|
|
115
|
+
|
|
116
|
+
```python
|
|
117
|
+
from behave_data import diff
|
|
118
|
+
|
|
119
|
+
diff(expected, actual, ordered=True, ignore_columns=None, surplus_columns=True)
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Raises `TableDiffError` if tables differ.
|
|
123
|
+
|
|
124
|
+
## resolve_placeholder
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
from behave_data import resolve_placeholder
|
|
128
|
+
|
|
129
|
+
resolve_placeholder(value, config, manager=None)
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Resolve `env:`, `file:`, `secret:`, `ref:` placeholders.
|
|
133
|
+
|
|
134
|
+
## register_type
|
|
135
|
+
|
|
136
|
+
```python
|
|
137
|
+
from behave_data import register_type
|
|
138
|
+
|
|
139
|
+
register_type("upper", lambda v: v.upper())
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Register a custom type converter for typed table headers.
|
|
143
|
+
|
|
144
|
+
## Hooks
|
|
145
|
+
|
|
146
|
+
```python
|
|
147
|
+
from behave_data import (
|
|
148
|
+
setup_data,
|
|
149
|
+
before_feature_hook,
|
|
150
|
+
before_scenario_hook,
|
|
151
|
+
before_step_hook,
|
|
152
|
+
after_scenario_hook,
|
|
153
|
+
)
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Exceptions
|
|
157
|
+
|
|
158
|
+
- `BehaveDataError` — base exception
|
|
159
|
+
- `TypeConversionError` — invalid type conversion
|
|
160
|
+
- `TableDiffError` — table mismatch
|
|
161
|
+
- `ColumnMismatchError` — column mismatch in table operations
|
|
162
|
+
- `LoaderNotFoundError` — unknown loader schema
|
|
163
|
+
- `FixtureNotFoundError` — unknown fixture
|
|
164
|
+
- `BuilderNotFoundError` — unknown builder
|
|
165
|
+
- `OptionalDependencyError` — missing optional dependency
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Builders
|
|
2
|
+
|
|
3
|
+
Builders construct test data. Unlike fixtures, they are designed for derived fields and batch generation.
|
|
4
|
+
|
|
5
|
+
## Basic builder
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
# features/environment.py
|
|
9
|
+
from behave_data import data_builder
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@data_builder("product")
|
|
13
|
+
def product(overrides):
|
|
14
|
+
return {
|
|
15
|
+
"name": "Widget",
|
|
16
|
+
"price": 9.99,
|
|
17
|
+
**overrides,
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Use in a step:
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
@when("I build a product")
|
|
25
|
+
def step_build_product(context):
|
|
26
|
+
context.product = context.data.build("product")
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Result:
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
{"name": "Widget", "price": 9.99}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## With overrides
|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
product = context.data.build(
|
|
39
|
+
"product",
|
|
40
|
+
overrides={"name": "Gadget", "price": 19.99},
|
|
41
|
+
)
|
|
42
|
+
# {"name": "Gadget", "price": 19.99}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Build multiple instances
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
products = context.data.build("product", count=3)
|
|
49
|
+
# 3 products with default values
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Derived fields
|
|
53
|
+
|
|
54
|
+
Use previous overrides inside the builder:
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
@data_builder("user")
|
|
58
|
+
def user(overrides):
|
|
59
|
+
base = {
|
|
60
|
+
"first_name": "Alice",
|
|
61
|
+
"last_name": "Smith",
|
|
62
|
+
}
|
|
63
|
+
base["full_name"] = f"{base['first_name']} {base['last_name']}"
|
|
64
|
+
return {**base, **overrides}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Manual registration
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
from behave_data import DataManager
|
|
71
|
+
|
|
72
|
+
dm = DataManager()
|
|
73
|
+
dm.builders.register("order", lambda o: {"items": [], **o})
|
|
74
|
+
order = dm.build("order")
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Builder not found
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
context.data.build("unknown")
|
|
81
|
+
# raises BuilderNotFoundError
|
|
82
|
+
```
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Configuration
|
|
2
|
+
|
|
3
|
+
behave-data can be configured via a YAML or JSON file, or directly in code.
|
|
4
|
+
|
|
5
|
+
## behave_data.yml
|
|
6
|
+
|
|
7
|
+
Create a `behave_data.yml` in the root of your project:
|
|
8
|
+
|
|
9
|
+
```yaml
|
|
10
|
+
null_markers:
|
|
11
|
+
- ""
|
|
12
|
+
- "null"
|
|
13
|
+
- "None"
|
|
14
|
+
- "N/A"
|
|
15
|
+
- "n/a"
|
|
16
|
+
|
|
17
|
+
secret_backend: file
|
|
18
|
+
secret_path: secrets/
|
|
19
|
+
load_base_dir: features/data/
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## behave_data.json
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"null_markers": ["", "null", "None", "N/A"],
|
|
27
|
+
"secret_backend": "file",
|
|
28
|
+
"secret_path": "secrets/",
|
|
29
|
+
"load_base_dir": "features/data/"
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## In code
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
from behave_data import Config
|
|
37
|
+
|
|
38
|
+
config = Config(
|
|
39
|
+
null_markers=frozenset({"", "null", "N/A"}),
|
|
40
|
+
secret_backend="env",
|
|
41
|
+
secret_path="secrets/",
|
|
42
|
+
load_base_dir="features/data/",
|
|
43
|
+
)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Options
|
|
47
|
+
|
|
48
|
+
| Option | Default | Description |
|
|
49
|
+
|--------|---------|-------------|
|
|
50
|
+
| `null_markers` | `{"", "null", "None", "N/A"}` | Values converted to `None` |
|
|
51
|
+
| `secret_backend` | `"file"` | Backend for `secret:` placeholders |
|
|
52
|
+
| `secret_path` | `"secrets/"` | Base path for `file:` secrets |
|
|
53
|
+
| `load_base_dir` | `"features/data/"` | Base path for dynamic Examples |
|
|
54
|
+
|
|
55
|
+
## Loading config manually
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
from behave_data import Config
|
|
59
|
+
|
|
60
|
+
config = Config.from_file("behave_data.yml")
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
If the file does not exist, a default `Config()` is returned.
|
|
64
|
+
|
|
65
|
+
## Passing config to setup_data
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
from behave_data import setup_data, Config
|
|
69
|
+
|
|
70
|
+
def before_all(context):
|
|
71
|
+
setup_data(context, Config.from_file("config/behave_data.yml"))
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Passing config to typed_wrap
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
from behave_data import typed_wrap, Config
|
|
78
|
+
|
|
79
|
+
config = Config(null_markers=frozenset({"", "missing"}))
|
|
80
|
+
result = typed_wrap(context.table, config).typed_dicts()
|
|
81
|
+
```
|