pytest-ves
pytest fixtures and builders for ONAP VES 7.x events.
Generate ready-to-use VES (Virtual Event Streaming, ONAP DCAE) event payloads in
Python tests — with sensible defaults, strong typing, and optional JSON Schema
validation against the official ONAP CommonEventFormat_30.2.1_ONAP.json.
Status: v0.1.0 in development. APIs may shift until 1.0.
Why
Testing O-RAN SMO / Non-RT RIC / rApp / VES Collector code in Python currently
requires either hand-writing VES JSON (error-prone, drifts with spec updates),
spinning up a Docker container (onap/integration-simulators-nf-simulator-ves-client)
just to emit a single event, or bridging through Robot Framework. This plugin
lets you write:
def test_fault_handler(ves_fault_event):
event = ves_fault_event(
source_name="nrCellDU=1",
alarm_condition="28",
event_severity="CRITICAL",
)
result = my_handler(event)
assert result.is_active
No container, no HTTP round-trip, no schema drift. The output is a plain
dict that validates against the official ONAP CommonEventFormat schema.
Install
Once the first release lands on PyPI:
pip install pytest-ves # core only
pip install "pytest-ves[fast]" # + jsonschema-rs (10-100x faster)
pip install "pytest-ves[factories]" # + polyfactory (random / fuzz data)
Pre-PyPI interim (this project has not yet published its first release): install directly from the git repo:
pip install "pytest-ves @ git+https://github.com/thc1006/pytest-ves.git@main"
# optional extras are honoured the same way:
pip install "pytest-ves[fast] @ git+https://github.com/thc1006/pytest-ves.git@main"
Or clone and install editable for local development:
git clone https://github.com/thc1006/pytest-ves.git
cd pytest-ves
uv sync --all-extras # or: pip install -e ".[fast,factories]"
Quickstart
import pytest
from pytest_ves import validate_ves
def test_fault_event_shape(ves_fault_event):
event = ves_fault_event(source_name="gNB-1", alarm_condition="28")
validate_ves(event) # raises jsonschema.ValidationError on failure
assert event["event"]["commonEventHeader"]["domain"] == "fault"
@pytest.mark.parametrize("severity", ["CRITICAL", "MAJOR", "MINOR"])
def test_severity_branches(ves_fault_event, severity):
event = ves_fault_event(event_severity=severity)
...
Supported VES versions
Single vendored schema (CommonEventFormat_30.2.1_ONAP.json) covers
7.0 / 7.0.1 / 7.1 / 7.1.1 / 7.2 / 7.2.1. Builders emit 7.2.1 defaults.
Fixture catalogue
Shipped
| Fixture | Domain | Since |
|---|---|---|
ves_fault_event |
fault | 0.1.0 |
ves_heartbeat_event |
heartbeat | 0.1.0 |
ves_measurement_event |
measurement | 0.1.0 |
ves_notification_event |
notification | 0.2.0 |
ves_pnf_registration_event |
pnfRegistration | 0.2.0 |
ves_stnd_defined_event |
stndDefined (envelope only -- see ADR-002) | 0.2.0 |
ves_syslog_event |
syslog | 0.2.0 |
ves_state_change_event |
stateChange | 0.2.0 |
ves_other_event |
other | 0.2.0 |
Roadmap (NOT shipped, DO NOT import)
Planned for v0.3.0 once their nested sub-object / array-of-object shapes
are modelled carefully. Attempting to use these right now will raise
fixture '<name>' not found.
| Fixture | Domain | Complexity |
|---|---|---|
ves_threshold_crossing_alert_event |
thresholdCrossingAlert | additionalParameters array-of-object |
ves_mobile_flow_event |
mobileFlow | nested gtpPerFlowMetrics object |
ves_sip_signaling_event |
sipSignaling | nested vendorNfNameFields |
ves_voice_quality_event |
voiceQuality | nested vendorNfNameFields + array |
ves_perf_3gpp_event |
perf3gpp | 3GPP-specific nested counters |
See docs/adr/ for design rationale. See CHANGELOG.md for release history.
Related projects
o-ran-smo-ves-dashboards(sister project, TBD) — Grafana dashboard pack for VES events stored in InfluxDB vianonrtric-plt-influxlogger. Usespytest-vesas its test-data seeder.o-ran-sc/smo-ves— upstream reference stack (VES Collector + Grafana + InfluxDB) used in our integration tests.onap/integration-simulators-nf-simulator-ves-client— upstream Java/Docker simulator; complementary tool, different use case.
License
Apache-2.0 for pytest-ves source. The vendored CommonEventFormat_30.2.1_ONAP.json
is Apache-2.0 © AT&T Intellectual Property (2020), Nokia Solutions and Networks
(2021). See NOTICE.
Release files for pytest-ves 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytest_ves-0.2.2.tar.gz | 31.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytest_ves-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 65.2 kB
Release files / pytest_ves-0.2.2.tar.gz
| Download URL | pytest_ves-0.2.2.tar.gz |
|---|---|
| Size | 31.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dd868223ba4f15d8ac0a026c1591107222aeb942643d313395a80d82935451e4
|
|
BLAKE2b-256 checksum How to use checksums |
22fb84868f03162bc6473f0702dfc02737302e49036a707bcb42b92b9f730412
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 18, 2026.
Transparency logRelease files / pytest_ves-0.2.2-py3-none-any.whl
| Download URL | pytest_ves-0.2.2-py3-none-any.whl |
|---|---|
| Size | 33.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
86826ba647f8d906571eb80ac44d407352b3da45212017a634b9d321f965eb9d
|
|
BLAKE2b-256 checksum How to use checksums |
9c0e93a46aa5cc9efdff3cbf05389de5d0100fb77cb5c33845039677db0a024d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 18, 2026.
Transparency log