Browse Source

test: add test suites of permanent rooms option

dev
Dnomd343 3 weeks ago
parent
commit
403341ff03
  1. 20
      tests/test_arg_opts.py
  2. 15
      tests/test_cfg_opts.py

20
tests/test_arg_opts.py

@ -87,6 +87,26 @@ def test_args_single_bool(name: str, arg_tag: str):
assert boot.load_from_args() == {name: True} assert boot.load_from_args() == {name: True}
@pytest.mark.parametrize(
'name, arg_tag',
[
('permanent_rooms', '--permanent-rooms'),
],
)
def test_args_str_list(name: str, arg_tag: str) -> None:
"""
Test command line arguments of string list option.
"""
sys.argv += [arg_tag]
assert boot.load_from_args() == {name: []}
sys.argv += [arg_tag, 'VALUE']
assert boot.load_from_args() == {name: ['VALUE']}
sys.argv += [arg_tag, 'V1', 'V2', 'V3']
assert boot.load_from_args() == {name: ['V1', 'V2', 'V3']}
def test_args_full(): def test_args_full():
""" """
Test all command line arguments options. Test all command line arguments options.

15
tests/test_cfg_opts.py

@ -98,6 +98,21 @@ def test_config_single_bool(name: str, cfg_tag: str) -> None:
verify_config({cfg_tag: False}, {name: False}) verify_config({cfg_tag: False}, {name: False})
@pytest.mark.parametrize(
'name, cfg_tag',
[
('permanent_rooms', 'permanent-rooms'),
],
)
def test_config_str_list(name: str, cfg_tag: str) -> None:
"""
Test configuration file of string list option.
"""
verify_config({cfg_tag: []}, {name: []})
verify_config({cfg_tag: ['VALUE']}, {name: ['VALUE']})
verify_config({cfg_tag: ['V1', 'V2', 'V3']}, {name: ['V1', 'V2', 'V3']})
def test_config_full(): def test_config_full():
""" """
Test all configuration file options. Test all configuration file options.

Loading…
Cancel
Save