acsresearch / interlab

MIT License
17 stars 2 forks source link

Failing console and storage tests #11

Closed gavento closed 1 year ago

gavento commented 1 year ago

As of 3f402b5, poetry run pytest shows this error in console and storage servers.

=========================================================================================================================== FAILURES ===========================================================================================================================
_____________________________________________________________________________________________________________________ test_console_server ______________________________________________________________________________________________________________________

    @pytest.mark.asyncio
    async def test_console_server():
        server = ConsoleServer("My console")
        server.add_message("First message")
        url = (server.handle.url + "/ws").replace("http", "ws")

        try:
            async with websockets.connect(url) as websocket:
                msg = await websocket.recv()
>               assert json.loads(msg) == {"name": "My console"}
E               AssertionError: assert {'name': 'My ...type': 'init'} == {'name': 'My console'}
E                 Omitting 1 identical items, use -vv to show
E                 Left contains 1 more item:
E                 {'type': 'init'}
E                 Use -v to get more diff

tests/test_console.py:19: AssertionError
_________________________________________________________________________________________________________________________ test_server __________________________________________________________________________________________________________________________

storage = <FileStorage directory='/tmp/pytest-of-gavento/pytest-9/test_server0/storage'>

    def test_server(storage):
        with Context("test1", storage=storage) as c1:
            with Context("test1-1"):
                pass

        with Context("test2", storage=storage) as c2:
            pass

        server = storage.start_server()
        try:
>           raise Exception("TODO")
E           Exception: TODO

tests/test_server.py:14: Exception
=================================================================================================================== short test summary info ====================================================================================================================
FAILED tests/test_console.py::test_console_server - AssertionError: assert {'name': 'My ...type': 'init'} == {'name': 'My console'}
FAILED tests/test_server.py::test_server - Exception: TODO
================================================================================================================= 2 failed, 21 passed in 0.65s =================================================================================================================