Files
zeekay 857ed3b5d0 feat: major v0.2.1 refactoring with .zap schema format
- Add native .zap schema files (zap.zap, addressbook.zap)
- Refactor Python bindings to zap_schema module
- Add zapc schema compiler binary
- Update Rust client/server/crypto/identity modules
- Add release workflow and build scripts
- Update TypeScript package configuration
- Add LLM documentation for AI assistants
2026-03-12 23:21:05 -07:00

33 lines
966 B
Python

"""Tests for zap_schema.error module."""
import pytest
from zap_schema.error import ZapError
class TestZapError:
"""Tests for ZapError class."""
def test_zap_error_creation(self):
"""Test creating a ZapError."""
error = ZapError("Something went wrong")
assert str(error) == "Something went wrong"
def test_zap_error_is_exception(self):
"""Test ZapError is an Exception."""
error = ZapError("test")
assert isinstance(error, Exception)
def test_zap_error_raise_and_catch(self):
"""Test raising and catching ZapError."""
with pytest.raises(ZapError) as exc_info:
raise ZapError("test error")
assert "test error" in str(exc_info.value)
def test_zap_error_subclass_behavior(self):
"""Test ZapError can be caught as Exception."""
try:
raise ZapError("test")
except Exception as e:
assert isinstance(e, ZapError)