swh_search_config_without_indexes = '/tmp/pytest-of-jenkins/pytest-0/test_server_first_call_initial1/search.yml'
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fd918272da0>
def test_server_first_call_initialize_elasticsearch_without_indexes(
swh_search_config_without_indexes, mocker
):
"""Test the initialize method is called during the first and first only
request to the server
The ElasticSearch object is instantiated only when a request is done
"""
mock = mocker.patch("swh.search.elasticsearch.ElasticSearch.initialize")
app = make_app_from_configfile()
app.config["TESTING"] = True
tc = app.test_client()
tc.get("/")
> assert mock.call_count == 1
E assert 0 == 1
E +0
E -1
.tox/py3/lib/python3.7/site-packages/swh/search/tests/test_server.py:176: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Mar 4 2021, 3:23 PM