From 2fdfa7b8307f490efe18ed3de4eadbd2bba0a4e6 Mon Sep 17 00:00:00 2001 From: Ryo Nakamura Date: Wed, 15 Mar 2023 22:20:00 +0900 Subject: test: add invalid kwargs test --- test/test_python.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'test/test_python.py') diff --git a/test/test_python.py b/test/test_python.py index 3ac2a6e..ea2d278 100644 --- a/test/test_python.py +++ b/test/test_python.py @@ -103,3 +103,22 @@ def test_login_failed(): m = mscp.mscp(remote, mscp.LOCAL2REMOTE, port = "65534") with pytest.raises(RuntimeError) as e: m.connect() + + +param_invalid_kwargs = [ + { "nr_threads": -1 }, + { "nr_ahead": -1 }, + { "min_chunk_sz": 1 }, + { "max_chunk_sz": 1 }, + { "coremask": "xxxxx" }, + { "max_startups": -1 }, + { "cipher": "invalid" }, + { "hmac": "invalid"}, + { "compress": "invalid"}, +] + +@pytest.mark.parametrize("kw", param_invalid_kwargs) +def test_invalid_options(kw): + with pytest.raises(RuntimeError) as e: + m = mscp.mscp("localhost", mscp.LOCAL2REMOTE, **kw) + m.connect() -- cgit v1.2.3