def test_pull_missed_statuses(self, mocked_get_plugin, mocked_get, ac, pc): uuid = 'd6e6335d-9568-4949-aef1-4107e34c5f28' plugin = mock.MagicMock() plugin.get_ports = mock.MagicMock(return_value=[{'id': uuid}]) mocked_get_plugin.return_value = plugin updater = OdlPortStatusUpdate() updater._pull_missed_statuses() mocked_get.assert_called_with(uuid)
def test_process_websocket_reconnect(self, mocked_thread): updater = OdlPortStatusUpdate() updater._process_websocket_reconnect( odl_ws_client.ODL_WEBSOCKET_CONNECTED) mocked_thread.assert_called() mocked_thread.return_value.start.assert_called()
def test_websock_recv(self, mocked_provisioning_complete): updater = OdlPortStatusUpdate() updater._process_websocket_recv(self.WEBSOCK_NOTIFICATION, False) mocked_provisioning_complete.assert_called_once() self.assertTrue(mocked_provisioning_complete.call_args[0][1] == 'd6e6335d-9568-4949-aef1-4107e34c5f28')
def test_object_create(self): OdlPortStatusUpdate()
def test_websock_recv(self, mocked_provisioning_complete): updater = OdlPortStatusUpdate() updater._process_websocket_recv(self.WEBSOCK_NOTIFICATION, False) mocked_provisioning_complete.assert_called_once() self.assertEqual(mocked_provisioning_complete.call_args[0][1], 'd6e6335d-9568-4949-aef1-4107e34c5f28')