Fix Windows tests and add ClientPool fallback

This commit is contained in:
thePR0M3TH3AN
2025-06-29 21:43:33 -04:00
parent 65244adf57
commit 5cd7d264f1
2 changed files with 19 additions and 1 deletions

View File

@@ -64,6 +64,7 @@ jobs:
python -m pip install --upgrade pip
pip install -r src/requirements.txt
- name: Run tests with coverage
shell: bash
run: |
pytest --cov=src --cov-report=xml --cov-report=term-missing \
--cov-fail-under=20 src/tests

View File

@@ -16,9 +16,26 @@ try:
from monstr.encrypt import Keys, NIP4Encrypt
from monstr.event.event import Event
except ImportError: # Fallback placeholders when monstr is unavailable
ClientPool = None
NIP4Encrypt = None
Event = None
class ClientPool: # minimal stub for tests when monstr is absent
def __init__(self, relays):
self.relays = relays
self.connected = True
async def run(self):
pass
def publish(self, event):
pass
def subscribe(self, handlers=None, filters=None, sub_id=None):
pass
def unsubscribe(self, sub_id):
pass
from .coincurve_keys import Keys
import threading