From 775da5c922d1671fc866a8558dcf4cf4b65b0f23 Mon Sep 17 00:00:00 2001 From: dbth <1097224+believethehype@users.noreply.github.com> Date: Wed, 8 Jan 2025 21:42:31 +0100 Subject: [PATCH] update tests, fix print --- nostr_dvm/dvm.py | 2 +- tests/chat_bot.py | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/nostr_dvm/dvm.py b/nostr_dvm/dvm.py index 4b5a01b..21465c0 100644 --- a/nostr_dvm/dvm.py +++ b/nostr_dvm/dvm.py @@ -963,7 +963,7 @@ class DVM: await asyncio.sleep(1) except BaseException: - print("ende") + print("end") print("and now my watch has ended.") diff --git a/tests/chat_bot.py b/tests/chat_bot.py index 2f2d812..f51bfc1 100644 --- a/tests/chat_bot.py +++ b/tests/chat_bot.py @@ -9,6 +9,7 @@ from duck_chat import ModelType from nostr_sdk import Keys, Kind from nostr_dvm.bot import Bot +from nostr_dvm.framework import DVMFramework from nostr_dvm.tasks.generic_dvm import GenericDVM from nostr_dvm.utils.admin_utils import AdminConfig from nostr_dvm.utils.dvmconfig import DVMConfig, build_default_config @@ -18,16 +19,17 @@ from nostr_dvm.utils.nip89_utils import NIP89Config, check_and_set_d_tag def playground(announce = False): - + framework = DVMFramework() identifier = "bot_test" bot_config = build_default_config(identifier) - bot_config.CHATBOT = True + bot_config.CHATBOT = False bot_config.DVM_KEY = "aa8ab5b774d47e7b29a985dd739cfdcccf93451678bf7977ba1b2e094ecd8b30" admin_config = AdminConfig() - admin_config.REBROADCAST_NIP65_RELAY_LIST = True - admin_config.UPDATE_PROFILE = True + admin_config.REBROADCAST_NIP65_RELAY_LIST = False + admin_config.UPDATE_PROFILE = False + bot_config.RELAY_LIST = ["wss://relay.primal.net", "wss://relay.nostrdvm.com", "wss://nostr.oxtr.dev"] x = threading.Thread(target=Bot, args=([bot_config, admin_config])) x.start() @@ -56,7 +58,7 @@ def playground(announce = False): } nip89config = NIP89Config() - nip89config.KIND = kind + nip89config.KIND = Kind(kind) nip89config.DTAG = check_and_set_d_tag(identifier, name, dvm_config.PRIVATE_KEY, nip89info["picture"]) nip89config.CONTENT = json.dumps(nip89info) @@ -79,7 +81,8 @@ def playground(announce = False): return result dvm.process = process # overwrite the process function with the above one - dvm.run(True) + framework.add(dvm) + #framework.run()