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

tests: Add verbosity test in argparser

parent 4d6b09cc
...@@ -17,6 +17,12 @@ def one_resource_mock(): ...@@ -17,6 +17,12 @@ def one_resource_mock():
yield m yield m
@pytest.fixture
def verbose_args_mock():
with patch("sys.argv", args_from_string("--resource res,connect,PUSH,127.0.0.1,8800 -v")) as m:
yield m
@pytest.fixture @pytest.fixture
def empty_args_mock(): def empty_args_mock():
with patch("sys.argv", args_from_string("")) as m: with patch("sys.argv", args_from_string("")) as m:
......
...@@ -50,3 +50,12 @@ def test_required_type_decline(zmq_context, one_resource_mock): ...@@ -50,3 +50,12 @@ def test_required_type_decline(zmq_context, one_resource_mock):
ctx = sn.SN(zmq_context) ctx = sn.SN(zmq_context)
assert ctx assert ctx
assert ctx.get_socket(("res", "PUB")) assert ctx.get_socket(("res", "PUB"))
def test_verbose(zmq_context, verbose_args_mock):
ctx = sn.SN(zmq_context)
import logging
logger = logging.getLogger("tests")
assert logger.getEffectiveLevel() == logging.DEBUG
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