+ with self.subTest("overdue"),\
+ mock.patch.object(store.Portfolio, "get_cryptoportfolio") as get,\
+ mock.patch.object(store.Portfolio, "report") as report,\
+ mock.patch.object(store.Portfolio, "next_wait_time") as wait,\
+ mock.patch.object(store.time, "sleep") as sleep:
+ wait.side_effect = Exception("Time over")
+ store.Portfolio.start_worker()
+
+ store.Portfolio.worker_notify.set()
+
+ store.Portfolio.callback.wait()
+
+ report.print_log.assert_called_once_with("[Worker] Fetching cryptoportfolio")
+ get.assert_called_once_with(refetch=True)
+ self.assertFalse(store.Portfolio.worker.is_alive())
+