From f61b65fa175846f971c6b33bcbd481f2d37356a0 Mon Sep 17 00:00:00 2001 From: Shatakshi Mishra Date: Thu, 8 Feb 2024 13:06:52 +0530 Subject: [PATCH] Fix some of the duplicate test names (#1668) --- tests/unit/actions/test_config.py | 10 +++++----- .../post_processors/test_playbook_artifact_save_as.py | 2 +- .../configuration_subsystem/test_settings_effective.py | 8 ++++---- tests/unit/logger/test_append.py | 4 ++-- tests/unit/logger/test_time_zone.py | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/unit/actions/test_config.py b/tests/unit/actions/test_config.py index c4bce3a9f..4d42b0231 100644 --- a/tests/unit/actions/test_config.py +++ b/tests/unit/actions/test_config.py @@ -8,19 +8,19 @@ from ansible_navigator.ui_framework.curses_defs import CursesLinePart -def test_color_menu_true(): +def test_config_color_menu_true(): """Test color menu for a val set to the default.""" entry = {"default": True} assert color_menu(0, "", entry) == (2, 0) -def test_color_menu_false(): +def test_config_color_menu_false(): """Test color menu for a val not set to default.""" entry = {"default": False} assert color_menu(0, "", entry) == (3, 0) -def test_content_heading_true(): +def test_config_content_heading_true(): """Test menu generation for a defaulted value.""" curses.initscr() curses.start_color() @@ -42,7 +42,7 @@ def test_content_heading_true(): assert heading[0][0].column == 0 -def test_content_heading_false() -> None: +def test_config_content_heading_false() -> None: """Test menu generation for a value not default.""" curses.initscr() curses.start_color() @@ -69,7 +69,7 @@ def test_content_heading_false() -> None: assert heading[0][0].column == 0 -def test_filter_content_keys() -> None: +def test_config_filter_content_keys() -> None: """Test filtering keys.""" obj = {"__key": "value", "key": "value"} ret = {"key": "value"} diff --git a/tests/unit/configuration_subsystem/post_processors/test_playbook_artifact_save_as.py b/tests/unit/configuration_subsystem/post_processors/test_playbook_artifact_save_as.py index 19405b957..f1119754c 100644 --- a/tests/unit/configuration_subsystem/post_processors/test_playbook_artifact_save_as.py +++ b/tests/unit/configuration_subsystem/post_processors/test_playbook_artifact_save_as.py @@ -69,7 +69,7 @@ def __str__(self): @pytest.mark.parametrize(argnames="data", argvalues=test_data, ids=id_func) -def test(data: Scenario): +def test_pas(data: Scenario): """Test the PAS post processor. :param data: The test data diff --git a/tests/unit/configuration_subsystem/test_settings_effective.py b/tests/unit/configuration_subsystem/test_settings_effective.py index 2b4527c1d..804ceaa42 100644 --- a/tests/unit/configuration_subsystem/test_settings_effective.py +++ b/tests/unit/configuration_subsystem/test_settings_effective.py @@ -21,7 +21,7 @@ from ansible_navigator.utils.json_schema import validate -def test_defaults(schema_dict: SettingsSchemaType): +def test_settings_defaults(schema_dict: SettingsSchemaType): """Check the settings file used as a sample against the schema. :param schema_dict: The json schema as a dictionary @@ -54,7 +54,7 @@ def test_settings_env_var_to_full( assert settings.internals.settings_source == Constants.ENVIRONMENT_VARIABLE -def test_cli(): +def test_settings_cli(): """Test the round trip generation of effective settings given some cli parameters.""" settings = deepcopy(NavigatorConfiguration) settings.internals.initializing = True @@ -70,7 +70,7 @@ def test_cli(): assert root["logging"]["level"] == "debug" -def test_env(monkeypatch: pytest.MonkeyPatch): +def test_settings_env(monkeypatch: pytest.MonkeyPatch): """Test the round trip generation of effective settings given some environment variables. :param monkeypatch: The pytest monkeypatch fixture @@ -94,7 +94,7 @@ def test_env(monkeypatch: pytest.MonkeyPatch): assert root["logging"]["level"] == "debug" -def test_full( +def test_settings_full( settings_env_var_to_full: tuple[Path, SettingsFileType], ): """Test the round trip generation of effective settings given a full settings file. diff --git a/tests/unit/logger/test_append.py b/tests/unit/logger/test_append.py index 1040113cc..8e7b243b4 100644 --- a/tests/unit/logger/test_append.py +++ b/tests/unit/logger/test_append.py @@ -31,7 +31,7 @@ def __str__(self): def args(self, log_file: Path) -> list[str]: """Provide an argument list for the CLI. - :param log_file: The path to the lgo file + :param log_file: The path to the log file :returns: The list of CLI arguments """ arg_list = [ @@ -53,7 +53,7 @@ def args(self, log_file: Path) -> list[str]: @pytest.mark.parametrize("data", test_data, ids=id_func) -def test(data: Scenario, monkeypatch: pytest.MonkeyPatch, tmp_path: Path): +def test_log_append(data: Scenario, monkeypatch: pytest.MonkeyPatch, tmp_path: Path): """Start with the CLI, create log messages and count. :param data: The test data diff --git a/tests/unit/logger/test_time_zone.py b/tests/unit/logger/test_time_zone.py index ab37a81b2..9accfa838 100644 --- a/tests/unit/logger/test_time_zone.py +++ b/tests/unit/logger/test_time_zone.py @@ -55,7 +55,7 @@ def args(self, log_file: Path) -> list[str]: @pytest.mark.parametrize("data", test_data, ids=id_func) -def test( +def test_tz_support( data: Scenario, caplog: pytest.LogCaptureFixture, monkeypatch: pytest.MonkeyPatch,