def test_subsequent_prepare_environment(mock_es_create, test_config): mock_es_create.side_effect = RequestError(400, 'IndexAlreadyExists errorito') app._prepare_environment(test_config)
def test_prepare_environment_err(mock_es_create, test_config): mock_es_create.side_effect = RequestError(123, 'Some other error') with pytest.raises(RequestError): app._prepare_environment(test_config)
def test_first_prepare_environment(mock_es_create, test_config): app._prepare_environment(test_config) mock_es_create.assert_called_with( index=test_config.elastic.elastic_index, body=test_config.elastic.metadata_index_setup)