File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -130,9 +130,11 @@ def fetch_visible_projects(self) -> list[dict]:
130
130
131
131
def check_health (self , actions : Actions ) -> ServiceHealth :
132
132
"""Check health for Jira Service"""
133
+ try :
134
+ is_up = self .client .get_server_info (True ) is not None
135
+ except requests .RequestException :
136
+ is_up = False
133
137
134
- server_info = self .client .get_server_info (True )
135
- is_up = server_info is not None
136
138
health : ServiceHealth = {
137
139
"up" : is_up ,
138
140
"all_projects_are_visible" : is_up and self ._all_projects_visible (actions ),
Original file line number Diff line number Diff line change @@ -79,9 +79,8 @@ def test_jira_retries_failing_connections_in_health_check(
79
79
body = ConnectionError (),
80
80
)
81
81
82
- with pytest .raises (ConnectionError ):
83
- jira .get_service ().check_health (actions_factory ())
84
-
82
+ healthcheck = jira .get_service ().check_health (actions_factory ())
83
+ assert healthcheck ["up" ] is False
85
84
assert len (mocked_responses .calls ) == 4
86
85
87
86
You can’t perform that action at this time.
0 commit comments