Skip to main content

Hivescope: E2E testing library for HiveMind protocol

Project description

Hivescope

A self-contained pytest-based E2E testing library for HiveMind protocol implementations.

Install

pip install "hivescope @ git+https://github.com/JarbasHiveMind/hivescope@dev"

With OVOS skill-level testing support:

pip install "hivescope[ovos] @ git+https://github.com/JarbasHiveMind/hivescope@dev"

Quick Start

from hivescope.scenarios import single_satellite
from hivescope.assertions import assert_handshake_complete, assert_encryption_match

def test_handshake():
    builder = single_satellite()
    builder.start_all()
    try:
        master = builder.get_master("M0")
        satellite = builder.get_satellite("S0")
        assert_handshake_complete(master, satellite)
        assert_encryption_match(master, satellite)
    finally:
        builder.stop_all()

Using pytest fixtures (add to tests/conftest.py):

pytest_plugins = ['hivescope.pytest_fixtures']
def test_message_forwarded(master_node, satellite_node):
    from ovos_bus_client.message import Message
    satellite_node.send(Message("test:ping", {}))
    master_node.recorder.assert_received("BUS", count=1)

Templates

Copy-paste test templates from templates/ into your repo's tests/e2e/:

Template Covers
test_template_handshake.py Cipher/encoding agreement, handshake completion
test_template_routing.py Message routing through master
test_template_acl.py ACL enforcement for restricted satellites
test_template_binary.py Binary protocol message handling

Configuration

Key Default Purpose
use_loopback False Pass True to add_master() to use loopback network protocol instead of in-process
[ovos] extra not installed Enables OvoscopeAgentProtocol backed by a live MiniCroft

API Reference

See docs/index.md for the full public API.

License

AGPL-3.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hivescope-0.3.0a1.tar.gz (47.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hivescope-0.3.0a1-py3-none-any.whl (46.6 kB view details)

Uploaded Python 3

File details

Details for the file hivescope-0.3.0a1.tar.gz.

File metadata

  • Download URL: hivescope-0.3.0a1.tar.gz
  • Upload date:
  • Size: 47.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hivescope-0.3.0a1.tar.gz
Algorithm Hash digest
SHA256 0168ed20733ffd804324f42883fa8847dc8e5d6b91ac544839052a3aad2d922b
MD5 9a8c54a533e0872030e0b2516f1fe052
BLAKE2b-256 c6c890e680b2bb08243e2f7b3c01ed91751af5f56f11efc7b2af27e314398936

See more details on using hashes here.

File details

Details for the file hivescope-0.3.0a1-py3-none-any.whl.

File metadata

  • Download URL: hivescope-0.3.0a1-py3-none-any.whl
  • Upload date:
  • Size: 46.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hivescope-0.3.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 bc36627a0d25fb8c9845661a5eea03d7e04e3b6cd8306e681de8c626bf6c46cb
MD5 2a08d5baf4d606267d3b635812fe22b0
BLAKE2b-256 a5b6f89315a24bf242e931e423e88b01e1da63872f41b4112a4ac22f3db3c12f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page