style: format and lint code
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user