From 6a1bb13feb5515905ea3e62ffd4a25fde02e5163 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 10 Jan 2023 13:16:45 -0500 Subject: [PATCH] Add base `pikerd` service tree custom check test --- tests/test_services.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tests/test_services.py diff --git a/tests/test_services.py b/tests/test_services.py new file mode 100644 index 00000000..19d38b54 --- /dev/null +++ b/tests/test_services.py @@ -0,0 +1,37 @@ +''' +Actor tree daemon sub-service verifications + +''' +from typing import AsyncContextManager + +import trio +import tractor + + +def test_runtime_boot( + open_test_pikerd: AsyncContextManager +): + ''' + Verify we can boot the `pikerd` service stack using the + `open_test_pikerd` fixture helper and that registry address details + match up. + + ''' + async def main(): + port = 6666 + daemon_addr = ('127.0.0.1', port) + + async with ( + open_test_pikerd( + reg_addr=daemon_addr, + ) as (_, _, pikerd_portal), + + tractor.wait_for_actor( + 'pikerd', + arbiter_sockaddr=daemon_addr, + ) as portal, + ): + assert pikerd_portal.channel.raddr == daemon_addr + assert pikerd_portal.channel.raddr == portal.channel.raddr + + trio.run(main)