[bitbake-devel] [selftest][PATCH V1 2/5] bitbake: tests: Add test for bb.event.worker_fire

Jair Gonzalez jair.de.jesus.gonzalez.plascencia at linux.intel.com
Thu Aug 17 20:40:51 UTC 2017


Test the triggering of bb.event.worker_fire callback.

Signed-off-by: Jair Gonzalez <jair.de.jesus.gonzalez.plascencia at linux.intel.com>
---
 lib/bb/tests/event.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lib/bb/tests/event.py b/lib/bb/tests/event.py
index 1ddcb41..f11fda5 100644
--- a/lib/bb/tests/event.py
+++ b/lib/bb/tests/event.py
@@ -388,6 +388,14 @@ class EventHandlingTest(unittest.TestCase):
         self.assertEqual(self._test_ui1.event.send.call_args_list,
                          expected)
 
+    def test_worker_fire(self):
+        """ Test the triggering of bb.event.worker_fire callback """
+        bb.event.worker_fire = Mock()
+        event = bb.event.Event()
+        bb.event.fire(event, None)
+        expected = [call(event, None)]
+        self.assertEqual(bb.event.worker_fire.call_args_list, expected)
+
     def test_print_ui_queue(self):
         """ Test print_ui_queue method """
         event1 = bb.event.OperationStarted()
-- 
2.7.4




More information about the bitbake-devel mailing list