예제 #1
0
    def test_handle_event(self, mock_device_configuration_complete):
        ndo_mgr = device_orchestrator.DeviceOrchestrator(object, cfg.CONF)
        mock_device_configuration_complete.return_value = True
        self.event = DummyEvent(dummy_data, 'DEVICE_CONFIGURED')
        self.event.id = 'DEVICE_CONFIGURED'

        ndo_mgr.handle_event(self.event)
        mock_device_configuration_complete.assert_called_with(self.event)
예제 #2
0
 def test_module_init(self, mock_rpc_init, mock_events_init):
     controller = "dummy-controller"
     config = "dummy-config"
     device_orchestrator.DeviceOrchestrator = mock.Mock()
     device_orchestrator.nfp_module_init(controller, config)
     mock_events_init.assert_called_once_with(
         controller, config, device_orchestrator.DeviceOrchestrator())
     mock_rpc_init.assert_called_once_with(controller, config)
예제 #3
0
 def _initialize_ndo_handler(self):
     ndo_handler = device_orchestrator.DeviceOrchestrator(
         DummyController, cfg.CONF)
     self.event = DummyEvent(dummy_data, 'PENDING_CREATE')
     return ndo_handler
 def _initialize_ndo_handler(self):
     ndo_handler = device_orchestrator.DeviceOrchestrator(
         object, cfg.CONF)
     self.event = DummyEvent(100, 'PENDING_CREATE')
     return ndo_handler