diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 440b0dd45..0f3f0a304 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -58,9 +58,9 @@ def test_option_types(node_factory): 'bool_opt': True, }) - n.daemon.is_in_log(r"option str_opt ok ") - n.daemon.is_in_log(r"option int_opt 22 ") - n.daemon.is_in_log(r"option bool_opt True ") + assert n.daemon.is_in_log(r"option str_opt ok ") + assert n.daemon.is_in_log(r"option int_opt 22 ") + assert n.daemon.is_in_log(r"option bool_opt True ") n.stop() # A blank bool_opt should default to false @@ -70,7 +70,7 @@ def test_option_types(node_factory): 'bool_opt': '', }) - n.daemon.is_in_log(r"option bool_opt False ") + assert n.daemon.is_in_log(r"option bool_opt True ") n.stop() # What happens if we give it a bad bool-option? @@ -103,13 +103,15 @@ def test_option_types(node_factory): 'str_opt': 'ok', 'int_opt': 22, 'bool_opt': 1, + 'allow-deprecated-apis': True }) - n.daemon.is_in_log(r"option str_opt ok ") - n.daemon.is_in_log(r"option int_opt 22 ") - n.daemon.is_in_log(r"option int_opt 22 ") - n.daemon.is_in_log(r"option bool_opt True ") - n.daemon.is_in_log(r"option bool_opt true ") + # because of how the python json parser works, since we're adding the deprecated + # string option after the 'typed' option in the JSON, the string option overwrites + # the earlier typed option in JSON parsing, resulting in a option set of only strings + assert n.daemon.is_in_log(r"option str_opt ok ") + assert n.daemon.is_in_log(r"option int_opt 22 ") + assert n.daemon.is_in_log(r"option bool_opt 1 ") n.stop()