Compare commits

...

3 Commits

Author SHA1 Message Date
Reinier van der Leer
2565476003 Merge remote-tracking branch 'origin/master' into reinier/fix-test_service_creation 2024-09-02 11:32:07 +02:00
Reinier van der Leer
475eb29432 format 2024-09-01 16:46:50 +02:00
Reinier van der Leer
e666a53f42 test(server): Fix test_service_creation
Starting Pyro within the test isn't necessary because a Pyro instance is already running due to the session-level `server` fixture.
2024-09-01 16:41:30 +02:00

View File

@@ -1,9 +1,4 @@
from autogpt_server.util.service import (
AppService,
PyroNameServer,
expose,
get_service_client,
)
from autogpt_server.util.service import AppService, expose, get_service_client
class TestService(AppService):
@@ -30,9 +25,8 @@ class TestService(AppService):
def test_service_creation():
with PyroNameServer():
with TestService():
client = get_service_client(TestService)
assert client.add(5, 3) == 8
assert client.subtract(10, 4) == 6
assert client.fun_with_async(5, 3) == 8
with TestService():
client = get_service_client(TestService)
assert client.add(5, 3) == 8
assert client.subtract(10, 4) == 6
assert client.fun_with_async(5, 3) == 8