From 03fc02e39aac3273d62303836caa7798bcf507aa Mon Sep 17 00:00:00 2001 From: Will Foster Date: Mon, 27 Apr 2026 12:17:27 +0100 Subject: [PATCH 1/2] chore: fix black formatting for CI. --- src/badfish/main.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/badfish/main.py b/src/badfish/main.py index 1cf5f55..3fec404 100755 --- a/src/badfish/main.py +++ b/src/badfish/main.py @@ -867,9 +867,10 @@ async def check_schedule_job_status(self, job_id): return False async def check_job_status(self, job_id): - with polling_progress( - self.console, self.retries, "Status", disable=self._progress_disabled - ) as (progress, task_id): + with polling_progress(self.console, self.retries, "Status", disable=self._progress_disabled) as ( + progress, + task_id, + ): for count in range(self.retries): _url = f"{self.host_uri}{self.manager_resource}/Jobs/{job_id}" self.http_client.get_request.cache_clear() @@ -1319,9 +1320,10 @@ async def polling_host_state(self, state, equals=True): state_str = "Not %s" % state if not equals else state self.logger.info("Polling for host state: %s" % state_str) desired_state = False - with polling_progress( - self.console, self.retries, "Host state", disable=self._progress_disabled - ) as (progress, task_id): + with polling_progress(self.console, self.retries, "Host state", disable=self._progress_disabled) as ( + progress, + task_id, + ): for count in range(self.retries): current_state = await self.get_power_state() if equals: @@ -1338,9 +1340,10 @@ async def polling_host_state(self, state, equals=True): async def poll_until_ready(self, check_func, description, sleep_interval=5, clear_cache=False): self.logger.info("Polling for %s" % description) - with polling_progress( - self.console, self.retries, "Host state", disable=self._progress_disabled - ) as (progress, task_id): + with polling_progress(self.console, self.retries, "Host state", disable=self._progress_disabled) as ( + progress, + task_id, + ): for count in range(self.retries): if clear_cache: self.http_client.get_request.cache_clear() From af074d839f21ff229ad1c4a9bb667c3a6d746f3e Mon Sep 17 00:00:00 2001 From: Will Foster Date: Mon, 27 Apr 2026 12:26:07 +0100 Subject: [PATCH 2/2] chore: fix importscp tests race condition --- tests/test_scp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_scp.py b/tests/test_scp.py index 3ef2ea3..4de772d 100644 --- a/tests/test_scp.py +++ b/tests/test_scp.py @@ -134,7 +134,7 @@ def test_pass(self, mock_get, mock_post, mock_delete): self.set_mock_response(mock_delete, 200, "OK") self.args = [self.option_arg, "./exports/"] _, err = self.badfish_call() - assert err == RESPONSE_EXPORT_SCP_PASS % (datetime.now().strftime("%Y-%m-%d_%H%M%S")) + assert err == RESPONSE_EXPORT_SCP_PASS % (fixed_datetime().strftime("%Y-%m-%d_%H%M%S")) @patch("aiohttp.ClientSession.delete") @patch("aiohttp.ClientSession.post")