def test_get_number_of_records(count): count.return_value = {"count": 10, "_shards": {"total": 5, "successful": 5, "failed": 0}} expected = 10 result = get_number_of_records("foo") assert expected == result
def hepnames(): """View for authors collection landing page.""" number_of_records = get_number_of_records('hepnames') return render_template( 'inspirehep_theme/search/collection_authors.html', collection='authors', number_of_records=number_of_records, )
def index(): """View for literature collection landing page.""" number_of_records = get_number_of_records('hep') return render_template( 'inspirehep_theme/search/collection_literature.html', collection='hep', number_of_records=number_of_records, )
def data(): """View for data collection landing page.""" number_of_records = get_number_of_records('data') return render_template( 'inspirehep_theme/search/collection_data.html', collection='data', number_of_records=number_of_records, )
def journals(): """View for journals collection landing page.""" number_of_records = get_number_of_records('journals') return render_template( 'inspirehep_theme/search/collection_journals.html', collection='journals', number_of_records=number_of_records, )
def experiments(): """View for experiments collection landing page.""" number_of_records = get_number_of_records('experiments') return render_template( 'inspirehep_theme/search/collection_experiments.html', collection='experiments', number_of_records=number_of_records, )
def institutions(): """View for institutions collection landing page.""" number_of_records = get_number_of_records('institutions') some_institutions = _get_some_institutions() return render_template( 'inspirehep_theme/search/collection_institutions.html', collection='institutions', number_of_records=number_of_records, result=some_institutions, )
def conferences(): """View for conferences collection landing page.""" number_of_records = get_number_of_records('conferences') upcoming_conferences = _get_upcoming_conferences() return render_template( 'inspirehep_theme/search/collection_conferences.html', collection='conferences', conferences_subject_areas=CONFERENCE_CATEGORIES_TO_SERIES, number_of_records=number_of_records, result=upcoming_conferences, )