From b47c8efe274bdab90a59e4c27b14c9d18cbf66a3 Mon Sep 17 00:00:00 2001 From: Christophe Olinger Date: Wed, 16 Dec 2015 15:25:03 +0100 Subject: [PATCH] Add test cases for shutdown_requested_date --- tests/test_worker.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_worker.py b/tests/test_worker.py index a81444f5..d2f5eae5 100644 --- a/tests/test_worker.py +++ b/tests/test_worker.py @@ -545,6 +545,10 @@ class TestWorkerShutdown(RQTestCase): self.assertTrue(w._stop_requested) self.assertTrue(os.path.exists(sentinel_file)) + shutdown_requested_date = w.shutdown_requested_date + self.assertIsNotNone(shutdown_requested_date) + self.assertEqual(type(shutdown_requested_date).__name__, 'datetime') + @slow def test_working_worker_cold_shutdown(self): """worker with an ongoing job receiving double SIGTERM signal and shutting down immediately""" @@ -562,3 +566,6 @@ class TestWorkerShutdown(RQTestCase): self.assertTrue(w._stop_requested) self.assertFalse(os.path.exists(sentinel_file)) + shutdown_requested_date = w.shutdown_requested_date + self.assertIsNotNone(shutdown_requested_date) + self.assertEqual(type(shutdown_requested_date).__name__, 'datetime')