pytest plugin providing declarative fixtures for ICP integration testing
Project description
ton-devtools-pytest
pytest plugin for declarative ICP integration testing.
Part of the ton-devtools monorepo.
What it does
Auto-registered pytest plugin that hides all ICP authentication boilerplate behind declarative fixtures:
icp_harness— generates wallets, signs proofs, issues JWTs in one callicp_strict_mode— enforces TRMC security policies, fails on violationsMockWallet— real ed25519 keypair, produces valid TON Connect 2.0 proofs
Installation
pip install ton-devtools-pytest
The plugin registers automatically via the pytest11 entry point.
No conftest.py configuration required.
Quick Start
from ton_devtools_pytest.asserts import assert_authenticated
async def test_profile_read(icp_harness):
user = icp_harness.create_mock_user(roles=["user"])
resp = await icp_harness.client.get("/me/profile")
assert resp.status_code == 200
async def test_high_risk_blocked(icp_strict_mode):
user = icp_strict_mode.create_mock_user(risk_score="high")
resp = await icp_strict_mode.client.post("/proposals", json={...})
icp_strict_mode.assert_no_high_risk_pass(resp)
CLI options
pytest --icp-base-url=http://localhost:8000 --icp-jwt-secret=your-secret
Or via environment variables: ICP_BASE_URL, ICP_JWT_SECRET.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ton_devtools_pytest-0.1.0.tar.gz.
File metadata
- Download URL: ton_devtools_pytest-0.1.0.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfba1813c4c341f40208a59e2f7a37a7287f2a5c1a37fdf1495e5fd584d49e36
|
|
| MD5 |
8e58296df4b0963fb70a99cfd895da96
|
|
| BLAKE2b-256 |
00c25dee820bfb91c92ca24cc3f81a930520caadb3c60b38f4d1738a1de1d5e5
|
File details
Details for the file ton_devtools_pytest-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ton_devtools_pytest-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df1a0047e9247be458935ca1bd89977f2257739788f3ffd1974aabc71c2700a9
|
|
| MD5 |
34eaafbcbf14c76bef36bc5ddd569695
|
|
| BLAKE2b-256 |
d175b4220b5ddd16f2ab1e5cfca31e7ad19bdab86c856b636842b5a4c6b6863e
|