'Check that only UDP is started if messaging transport is unset.'

@mock.patch.object(collector.CollectorService, 'start_udp')
def test_only_udp(self, udp_start):

    self._setup_messaging(False)
    udp_socket = self._make_fake_socket(self.sample)
    real_start = oslo_messaging.MessageHandlingServer.start
    with mock.patch.object(oslo_messaging.MessageHandlingServer, 'start', side_effect=real_start) as rpc_start:
        with mock.patch('socket.socket', return_value=udp_socket):
            self.srv.run()
            self.addCleanup(self.srv.terminate)
            self.srv.udp_thread.join(5)
            self.assertFalse(self.srv.udp_thread.is_alive())
            self.assertEqual(0, rpc_start.call_count)
            self.assertEqual(1, udp_start.call_count)
