Esempio n. 1
0
def test_server_public_key_caches(load_rsa_key, config, ssl_provider):
    server_public_key = mock.Mock()
    ssl_provider.cache = server_public_key
    assert ssl_provider._load_rsa_key(
        key='plugin.ssl_server_public',
        cache=ssl_provider.cache) == server_public_key
    assert load_rsa_key.called is False
def test_set_listeners(config, conn_mock):
    listener = mock.Mock()
    with mock.patch.dict(ConnectorFake.listeners, {'tracker': listener}):
        connector = ConnectorFake(config=config, connection=conn_mock)

    conn_mock.set_listener.assert_called_once_with('tracker',
                                                   listener.return_value)
    listener.assert_called_once_with(connector=connector, config=config)
def test_security__caches_security(get_security, result_listener):
    security = mock.Mock()
    result_listener._security = security
    assert result_listener.security == security
    assert get_security.called is False
def condition():
    return mock.Mock()
Esempio n. 5
0
def security():
    return mock.Mock()
def msg():
    return mock.Mock()
 def __init__(self, *args, **kwargs):
     super(FakeProvider, self).__init__(*args, **kwargs)
     self.serializer = mock.Mock()
def test_connector_security__caches_security(get_security, fake_connector):
    security = mock.Mock()
    fake_connector._security = security
    assert fake_connector.security == security
    assert get_security.called is False
def logger():
    return mock.Mock()
def connector():
    return mock.Mock()