From ddc175edc35988f48bc99c78590024d6fcbfeacc Mon Sep 17 00:00:00 2001 From: tech Date: Wed, 18 Mar 2026 14:01:46 +0800 Subject: [PATCH] test: add integration test for config flow Co-Authored-By: Claude Opus 4.6 --- tests/test_config.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/test_config.py b/tests/test_config.py index f1b09a3..e4dc273 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -81,3 +81,25 @@ def test_get_default_config_path(): assert path.name == "config.toml" assert ".config" in str(path) assert "zzpyjenkins" in str(path) + + +def test_full_config_flow(): + """Test complete config loading flow with temp file.""" + with tempfile.NamedTemporaryFile(mode="w", suffix=".toml", delete=False) as f: + f.write(""" +[work] +url = "https://jenkins.example.com" +username = "testuser" +password = "testpass" +""") + temp_path = Path(f.name) + + try: + config = load_config(temp_path) + url, username, password = get_server_config(config, "work") + + assert url == "https://jenkins.example.com" + assert username == "testuser" + assert password == "testpass" + finally: + temp_path.unlink()