From 0ebfc4420b20f363ddabef5c44e51b591265b8d1 Mon Sep 17 00:00:00 2001 From: Andrei Neagu Date: Thu, 21 Mar 2024 11:06:38 +0100 Subject: [PATCH] refactor tests --- docker/activity_monitor.py | 3 +++ tests/test_activity_monitor.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/docker/activity_monitor.py b/docker/activity_monitor.py index 5bfaada..3b36ffc 100755 --- a/docker/activity_monitor.py +++ b/docker/activity_monitor.py @@ -248,6 +248,9 @@ async def get(self): "cpu_usage": { "is_busy": self.activity_manager.cpu_usage_monitor.is_busy, }, + "disk_usage": { + "is_busy": self.activity_manager.disk_usage_monitor.is_busy + }, "kernel_monitor": { "is_busy": self.activity_manager.jupyter_kernel_monitor.is_busy }, diff --git a/tests/test_activity_monitor.py b/tests/test_activity_monitor.py index 3a160f0..b3b7ebf 100644 --- a/tests/test_activity_monitor.py +++ b/tests/test_activity_monitor.py @@ -54,6 +54,7 @@ async def test_cpu_usage_monitor_not_busy( stop=stop_after_delay(5), wait=wait_fixed(0.1), reraise=True ): with attempt: + assert cpu_usage_monitor._get_total_cpu_usage() == 0 assert cpu_usage_monitor.is_busy is False @@ -70,6 +71,7 @@ async def test_cpu_usage_monitor_still_busy( time.sleep(1) # must still result busy + assert cpu_usage_monitor._get_total_cpu_usage() > 0 assert cpu_usage_monitor.is_busy is True