From ea0d6f0141032af9f95215c9af8e13bf7892e77a Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Mon, 7 Jun 2021 12:14:49 -0400 Subject: [PATCH] island: Add a generalized testing function to test_island_config_options --- .../monkey_island/cc/setup/test_island_config_options.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/monkey/tests/unit_tests/monkey_island/cc/setup/test_island_config_options.py b/monkey/tests/unit_tests/monkey_island/cc/setup/test_island_config_options.py index ae26d5145..df3c0dabd 100644 --- a/monkey/tests/unit_tests/monkey_island/cc/setup/test_island_config_options.py +++ b/monkey/tests/unit_tests/monkey_island/cc/setup/test_island_config_options.py @@ -51,8 +51,12 @@ def set_home_env(monkeypatch, tmpdir): def assert_island_config_options_data_dir_equals(config_file_contents, expected_data_dir): + assert_island_config_option_equals(config_file_contents, "data_dir", expected_data_dir) + + +def assert_island_config_option_equals(config_file_contents, option_name, expected_value): options = IslandConfigOptions(config_file_contents) - assert options.data_dir == expected_data_dir + assert getattr(options, option_name) == expected_value def test_island_config_options__log_level():