style: format and lint code

This commit is contained in:
2026-03-18 14:03:20 +08:00
parent f1a75cab8c
commit d88cedc8a0

View File

@@ -40,7 +40,7 @@ def test_get_server_config_success():
"work": { "work": {
"url": "https://jenkins.example.com", "url": "https://jenkins.example.com",
"username": "user", "username": "user",
"password": "pass" "password": "pass",
} }
} }
result = get_server_config(config, "work") result = get_server_config(config, "work")
@@ -53,7 +53,7 @@ def test_get_server_config_not_found():
"work": { "work": {
"url": "https://jenkins.example.com", "url": "https://jenkins.example.com",
"username": "user", "username": "user",
"password": "pass" "password": "pass",
} }
} }
with pytest.raises(ConfigError) as exc_info: with pytest.raises(ConfigError) as exc_info:
@@ -64,12 +64,7 @@ def test_get_server_config_not_found():
def test_get_server_config_missing_field(): def test_get_server_config_missing_field():
"""Test error when required field is missing.""" """Test error when required field is missing."""
config = { config = {"incomplete": {"url": "https://jenkins.example.com", "username": "user"}}
"incomplete": {
"url": "https://jenkins.example.com",
"username": "user"
}
}
with pytest.raises(ConfigError) as exc_info: with pytest.raises(ConfigError) as exc_info:
get_server_config(config, "incomplete") get_server_config(config, "incomplete")
assert "password" in str(exc_info.value) assert "password" in str(exc_info.value)