mirror of
https://github.com/chatmail/relay.git
synced 2026-05-10 16:04:37 +00:00
address review comments: renamed test and using socketserver ThreadingUnixStreamServer
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
import logging
|
||||
import os
|
||||
from socketserver import (
|
||||
StreamRequestHandler,
|
||||
ThreadingMixIn,
|
||||
UnixStreamServer,
|
||||
)
|
||||
from socketserver import StreamRequestHandler, ThreadingUnixStreamServer
|
||||
|
||||
|
||||
class DictProxy:
|
||||
@@ -86,12 +82,8 @@ class DictProxy:
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
with ThreadedUnixStreamServer(socket, Handler) as server:
|
||||
with ThreadingUnixStreamServer(socket, Handler) as server:
|
||||
try:
|
||||
server.serve_forever()
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
|
||||
|
||||
class ThreadedUnixStreamServer(ThreadingMixIn, UnixStreamServer):
|
||||
request_queue_size = 100
|
||||
|
||||
@@ -129,7 +129,7 @@ def test_handle_dovecot_protocol_hello_is_skipped(db, example_config, caplog):
|
||||
assert not caplog.messages
|
||||
|
||||
|
||||
def test_handle_dovecot_protocol(db, example_config):
|
||||
def test_handle_dovecot_protocol_user_not_exists(db, example_config):
|
||||
dictproxy = AuthDictProxy(db=db, config=example_config)
|
||||
rfile = io.BytesIO(
|
||||
b"H3\t2\t0\t\tauth\nLshared/userdb/foobar@chat.example.org\tfoobar@chat.example.org\n"
|
||||
|
||||
Reference in New Issue
Block a user