

def test_get_notifier_null_publisher(self):
    rpc.LEGACY_NOTIFIER = mock.Mock()
    mock_prep = mock.Mock()
    mock_prep.return_value = 'notifier'
    rpc.LEGACY_NOTIFIER.prepare = mock_prep
    notifier = rpc.get_notifier('service', host='bar')
    mock_prep.assert_called_once_with(publisher_id='service.bar')
    self.assertIsInstance(notifier, rpc.LegacyValidatingNotifier)
    self.assertEqual('notifier', notifier.notifier)

dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/test_rpc.py TestRPC.test_get_notifier_null_publisher/original