Ejemplo n.º 1
0
    def test_fire(self, salt_utils_event):
        """
        Test to fire an event on the local minion event bus.
        Data must be formed as a dict.
        """
        with patch.object(salt_utils_event, "get_event"):
            self.assertFalse(event.fire("data", "tag"))

        with patch.dict(event.__opts__, {"sock_dir": True, "transport": True}):
            with patch.object(salt_utils_event, "get_event") as mock:
                mock.fire_event = MagicMock(return_value=True)
                self.assertTrue(event.fire("data", "tag"))
Ejemplo n.º 2
0
    def test_fire(self, salt_utils_event):
        '''
        Test to fire an event on the local minion event bus.
        Data must be formed as a dict.
        '''
        with patch.object(salt_utils_event, 'get_event'):
            self.assertFalse(event.fire('data', 'tag'))

        with patch.dict(event.__opts__, {'sock_dir': True, 'transport': True}):
            with patch.object(salt_utils_event, 'get_event') as mock:
                mock.fire_event = MagicMock(return_value=True)
                self.assertTrue(event.fire('data', 'tag'))
Ejemplo n.º 3
0
    def test_fire(self, salt_utils_event):
        '''
        Test to fire an event on the local minion event bus.
        Data must be formed as a dict.
        '''
        with patch.object(salt_utils_event, 'get_event'):
            self.assertFalse(event.fire('data', 'tag'))

        with patch.dict(event.__opts__, {'sock_dir': True, 'transport': True}):
            with patch.object(salt_utils_event, 'get_event') as mock:
                mock.fire_event = MagicMock(return_value=True)
                self.assertTrue(event.fire('data', 'tag'))
Ejemplo n.º 4
0
 def test_fire(self, salt_utils_event):
     '''
     Test to fire an event on the local minion event bus.
     Data must be formed as a dict.
     '''
     with patch.object(salt_utils_event, 'get_event') as mock:
         mock.fire_event = MagicMock(return_value=True)
         self.assertTrue(event.fire('data', 'tag'))
Ejemplo n.º 5
0
 def test_fire(self):
     """
     Test to fire an event on the local minion event bus.
     Data must be formed as a dict.
     """
     with patch("salt.utils.event") as salt_utils_event:
         with patch.object(salt_utils_event, "get_event") as mock:
             mock.fire_event = MagicMock(return_value=True)
             self.assertTrue(event.fire("data", "tag"))