Right now, the code has several test branches, mainly to do with data ingestion. This makes it impossible to cover the whole codes with tests (and is also bad practice, because we do not test the actual code). We should therefore remove theses cases and instead switch to testing with a proper TCP server, e.g. using https://github.com/pytest-dev/pytest-tcpclient.