コード例 #1
0
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
コード例 #2
0
ファイル: views.py プロジェクト: Panos512/inspire-next
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,
    )
コード例 #3
0
ファイル: views.py プロジェクト: Panos512/inspire-next
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,
    )
コード例 #4
0
ファイル: views.py プロジェクト: Panos512/inspire-next
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,
    )
コード例 #5
0
ファイル: views.py プロジェクト: Panos512/inspire-next
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,
    )
コード例 #6
0
ファイル: views.py プロジェクト: Panos512/inspire-next
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,
    )
コード例 #7
0
ファイル: views.py プロジェクト: Panos512/inspire-next
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,
    )
コード例 #8
0
ファイル: views.py プロジェクト: Panos512/inspire-next
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,
    )