Commit bce2bf4e authored by Robin Obůrka's avatar Robin Obůrka

tests: argparser: Test "required socket type" feature too

parent 728a6e9c
......@@ -54,3 +54,7 @@ def bind_args(request):
])
def multisock_args(request):
return request.param.split(" ")
@pytest.fixture
def required_args():
return "--resource res,connect,PUSH,127.0.0.1,8800".split(" ")
......@@ -24,6 +24,18 @@ def test_bind_args(zmq_context, arg_parser, bind_args):
def test_multisock_args(zmq_context, arg_parser, multisock_args):
ctx = sn.SN(zmq_context, arg_parser, args=multisock_args)
assert ctx
r1, r2 = ctx.get_socket("res1", "res2")
assert r1
assert r2
def test_required_accept(zmq_context, arg_parser, required_args):
ctx = sn.SN(zmq_context, arg_parser, args=required_args)
assert ctx
assert ctx.get_socket(("res", "PUSH"))
def test_required_decline(zmq_context, arg_parser, required_args):
with pytest.raises(sn.SockConfigError):
ctx = sn.SN(zmq_context, arg_parser, args=required_args)
assert ctx
assert ctx.get_socket(("res", "PUB"))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment