sunank200 commented on code in PR #48403:
URL: https://github.com/apache/airflow/pull/48403#discussion_r2024606040
##########
airflow-core/tests/unit/cli/commands/test_config_command.py:
##########
@@ -491,3 +493,74 @@ def test_lint_detects_invalid_config_negative(self):
normalized_output = re.sub(r"\s+", " ", output.strip())
assert "Invalid value" not in normalized_output
+
+
+class TestCliConfigUpdate:
+ @classmethod
+ def setup_class(cls):
+ cls.parser = cli_parser.get_parser()
+
+ @pytest.fixture(autouse=True)
+ def setup_fake_airflow_cfg(self, tmp_path, monkeypatch):
+ fake_config = tmp_path / "airflow.cfg"
+ fake_config.write_text(
+ "[test_admin]\n"
+ "rename_key = legacy_value\n"
+ "remove_key = to_be_removed\n\n"
+ "[test_core]\n"
+ "dags_folder = /some/path/to/dags\n"
+ "default_key = OldDefault\n"
+ )
+ monkeypatch.setenv("AIRFLOW_CONFIG", str(fake_config))
+ monkeypatch.setattr(config_command, "AIRFLOW_CONFIG", str(fake_config))
+ conf.read(str(fake_config))
+ self.fake_config = fake_config
Review Comment:
Added a test fixture and did the suggested change above.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]