Пример #1
0
def test_format_output_row_title():
    record = Record({})
    latex = Latex(record, 'latex_eu')

    expected = u"  %``Partial Symmetries of Weak Interactions,''\n"
    result = latex._format_output_row('title', 'Partial Symmetries of Weak Interactions')

    assert expected == result
Пример #2
0
def test_format_output_row_more_than_eight_authors_collaboration_an_empty_list():
    collaboration_an_empty_list = Record({'collaboration': []})
    latex = Latex(collaboration_an_empty_list, 'latex_eu')

    expected = '  0 {\\it et al.}'
    result = latex._format_output_row('author', [str(i) for i in range(9)])

    assert expected == result
Пример #3
0
def test_format_output_row_publi_info_not_a_list():
    record = Record({})
    latex = Latex(record, 'latex_eu')

    expected = u'  Phys. Lett. 12 (1964) 132-133.\n'
    result = latex._format_output_row('publi_info', 'Phys. Lett. 12 (1964) 132-133')

    assert expected == result
Пример #4
0
def test_format_output_row_arxiv_with_publi_info():
    with_publi_info = {'publication_info': [{'journal_title': ''}]}
    latex = Latex(with_publi_info, 'latex_eu')

    expected = u'  [arXiv:1512.01381 [hep-th]].\n'
    result = latex._format_output_row('arxiv', 'arXiv:1512.01381 [hep-th]')

    assert expected == result
Пример #5
0
def test_format_output_row_one_author():
    record = Record({})
    latex = Latex(record, 'latex_eu')

    expected = u'  S.~L.~Glashow,\n'
    result = latex._format_output_row('author', ['S.~L.~Glashow'])

    assert expected == result
Пример #6
0
def test_format_output_row_unknown_field():
    record = InspireRecord({})
    latex = Latex(record, 'latex_eu')

    expected = ''
    result = latex._format_output_row('unknown_field', 'foo')

    assert expected == result
Пример #7
0
def test_format_output_row_report_number():
    record = InspireRecord({})
    latex = Latex(record, 'latex_eu')

    expected = u'  CMS-PAS-TOP-13-007.\n'
    result = latex._format_output_row('report_number', 'CMS-PAS-TOP-13-007')

    assert expected == result
Пример #8
0
def test_format_output_row_title():
    record = InspireRecord({})
    latex = Latex(record, 'latex_eu')

    expected = u"  %``Partial Symmetries of Weak Interactions,''\n"
    result = latex._format_output_row('title', 'Partial Symmetries of Weak Interactions')

    assert expected == result
Пример #9
0
def test_format_output_row_one_author():
    record = InspireRecord({})
    latex = Latex(record, 'latex_eu')

    expected = u'  S.~L.~Glashow,\n'
    result = latex._format_output_row('author', ['S.~L.~Glashow'])

    assert expected == result
Пример #10
0
def test_format_output_row_between_one_and_eight_authors():
    record = Record({})
    latex = Latex(record, 'latex_eu')

    expected = u'  F.~Englert and R.~Brout,\n'
    result = latex._format_output_row('author', ['F.~Englert', 'R.~Brout'])

    assert expected == result
Пример #11
0
def test_format_output_row_report_number():
    record = Record({})
    latex = Latex(record, 'latex_eu')

    expected = u'  CMS-PAS-TOP-13-007.\n'
    result = latex._format_output_row('report_number', 'CMS-PAS-TOP-13-007')

    assert expected == result
Пример #12
0
def test_format_output_row_unknown_field():
    record = Record({})
    latex = Latex(record, 'latex_eu')

    expected = ''
    result = latex._format_output_row('unknown_field', 'foo')

    assert expected == result
Пример #13
0
def test_format_output_row_arxiv_without_publi_info():
    without_publi_info = Record({})
    latex = Latex(without_publi_info, 'latex_eu')

    expected = u'  arXiv:1512.01296 [hep-th].\n'
    result = latex._format_output_row('arxiv', 'arXiv:1512.01296 [hep-th]')

    assert expected == result
Пример #14
0
def test_format_output_row_publi_info_not_a_list():
    record = InspireRecord({})
    latex = Latex(record, 'latex_eu')

    expected = u'  Phys. Lett. 12 (1964) 132-133.\n'
    result = latex._format_output_row('publi_info', 'Phys. Lett. 12 (1964) 132-133')

    assert expected == result
Пример #15
0
def test_format_output_row_between_one_and_eight_authors():
    record = InspireRecord({})
    latex = Latex(record, 'latex_eu')

    expected = u'  F.~Englert and R.~Brout,\n'
    result = latex._format_output_row('author', ['F.~Englert', 'R.~Brout'])

    assert expected == result
Пример #16
0
def test_format_output_row_more_than_eight_authors_collaboration_an_empty_list():
    collaboration_an_empty_list = InspireRecord({'collaboration': []})
    latex = Latex(collaboration_an_empty_list, 'latex_eu')

    expected = '  0 {\\it et al.}'
    result = latex._format_output_row('author', [str(i) for i in range(9)])

    assert expected == result
Пример #17
0
def test_format_output_row_arxiv_without_publi_info():
    without_publi_info = InspireRecord({})
    latex = Latex(without_publi_info, 'latex_eu')

    expected = u'  arXiv:1512.01296 [hep-th].\n'
    result = latex._format_output_row('arxiv', 'arXiv:1512.01296 [hep-th]')

    assert expected == result
Пример #18
0
def test_format_output_row_publi_info_a_list_with_one_element():
    record = {}
    latex = Latex(record, 'latex_eu')

    expected = u'  Phys.\\ Rev.\\ D {\\bf 73} (2006) 014022\n'
    result = latex._format_output_row(
        'publi_info', ['Phys.\\ Rev.\\ D {\\bf 73} (2006) 014022'])

    assert expected == result
Пример #19
0
def test_format_output_row_publi_info_a_list_with_one_element():
    record = Record({})
    latex = Latex(record, 'latex_eu')

    expected = u'  Phys.\\ Rev.\\ D {\\bf 73} (2006) 014022\n'
    result = latex._format_output_row('publi_info', [
        'Phys.\\ Rev.\\ D {\\bf 73} (2006) 014022'
    ])

    assert expected == result
Пример #20
0
def test_format_output_row_more_than_eight_authors_no_collaboration():
    without_collaboration = InspireRecord({})
    latex = Latex(without_collaboration, 'latex_eu')

    expected = u'  L.~Cadamuro {\it et al.},\n'
    result = latex._format_output_row('author', [
        'L.~Cadamuro', 'M.~Calvi', 'L.~Cassina', 'A.~Giachero', 'C.~Gotti',
        'B.~Khanji', 'M.~Maino', 'C.~Matteuzzi', 'G.~Pessina'
    ])

    assert expected == result
Пример #21
0
def test_format_output_row_more_than_eight_authors_no_collaboration():
    without_collaboration = Record({})
    latex = Latex(without_collaboration, 'latex_eu')

    expected = u'  L.~Cadamuro {\it et al.},\n'
    result = latex._format_output_row('author', [
        'L.~Cadamuro', 'M.~Calvi', 'L.~Cassina', 'A.~Giachero', 'C.~Gotti',
        'B.~Khanji', 'M.~Maino', 'C.~Matteuzzi', 'G.~Pessina'
    ])

    assert expected == result
Пример #22
0
def test_format_output_row_arxiv_with_publi_info():
    with_publi_info = Record({
        'publication_info': [
            {'journal_title': ''}
        ]
    })
    latex = Latex(with_publi_info, 'latex_eu')

    expected = u'  [arXiv:1512.01381 [hep-th]].\n'
    result = latex._format_output_row('arxiv', 'arXiv:1512.01381 [hep-th]')

    assert expected == result
Пример #23
0
def test_format_output_row_publi_info_a_list_with_two_elelemts():
    record = InspireRecord({})
    latex = Latex(record, 'latex_eu')

    expected = u'''  Int.\\ J.\\ Theor.\\ Phys.\\  {\\bf 38} (1999) 1113
    [Adv.\\ Theor.\\ Math.\\ Phys.\\  {\\bf 2} (1998) 231]
'''

    result = latex._format_output_row('publi_info', [
        'Int.\\ J.\\ Theor.\\ Phys.\\  {\\bf 38} (1999) 1113',
        '[Adv.\\ Theor.\\ Math.\\ Phys.\\  {\\bf 2} (1998) 231]'
    ])

    assert expected == result
Пример #24
0
def test_format_output_row_publi_info_a_list_with_two_elelemts():
    record = Record({})
    latex = Latex(record, 'latex_eu')

    expected = u'''  Int.\\ J.\\ Theor.\\ Phys.\\  {\\bf 38} (1999) 1113
    [Adv.\\ Theor.\\ Math.\\ Phys.\\  {\\bf 2} (1998) 231]
'''

    result = latex._format_output_row('publi_info', [
        'Int.\\ J.\\ Theor.\\ Phys.\\  {\\bf 38} (1999) 1113',
        '[Adv.\\ Theor.\\ Math.\\ Phys.\\  {\\bf 2} (1998) 231]'
    ])

    assert expected == result
Пример #25
0
def test_format_output_row_more_than_eight_authors_collaboration_in_collaboration():
    collaboration_in_collaboration = Record({
        'collaboration': [
            {'value': 'The ATLAS Collaboration'}
        ]
    })
    latex = Latex(collaboration_in_collaboration, 'latex_eu')

    expected = u'  G.~Aad {{\it et al.}} [The ATLAS Collaboration],\n'
    result = latex._format_output_row('author', [
        'G.~Aad', 'B.~Abbott', 'J.~Abdallah', 'O.~Abdinov', 'B.~Abeloos',
        'R.~Aben', 'M.~Abolins', 'O.~AbouZeid', 'H.~Abramowicz'
    ])

    assert expected == result
Пример #26
0
def test_format_output_row_more_than_eight_authors_collaboration_in_collaboration():
    collaboration_in_collaboration = InspireRecord({
        'collaboration': [
            {'value': 'The ATLAS Collaboration'}
        ]
    })
    latex = Latex(collaboration_in_collaboration, 'latex_eu')

    expected = u'  G.~Aad {{\it et al.}} [The ATLAS Collaboration],\n'
    result = latex._format_output_row('author', [
        'G.~Aad', 'B.~Abbott', 'J.~Abdallah', 'O.~Abdinov', 'B.~Abeloos',
        'R.~Aben', 'M.~Abolins', 'O.~AbouZeid', 'H.~Abramowicz'
    ])

    assert expected == result
Пример #27
0
def test_format_output_row_more_than_eight_authors_collaboration():
    with_collaboration = InspireRecord(
        {'collaboration': [{
            'value': 'Supernova Search Team'
        }]})
    latex = Latex(with_collaboration, 'latex_eu')

    expected = u'  A.~G.~Riess {{\\it et al.}} [Supernova Search Team Collaboration],\n'
    result = latex._format_output_row('author', [
        'A.~G.~Riess', 'A.~V.~Filippenko', 'P.~Challis', 'A.~Clocchiattia',
        'A.~Diercks', 'P.~M.~Garnavich', 'R.~L.~Gilliland', 'C.~J.~Hogan',
        'S.~Jha', 'R.~P.~Kirshner', 'B.~Leibundgut', 'M.~M.~Phillips',
        'D.~Reiss', 'B.~P.~Schmidt', 'R.~A.~Schommer', 'R.~C.~Smith',
        'J.~Spyromilio', 'C.~Stubbs', 'N.~B.~Suntzeff', 'J.~Tonry'
    ])

    assert expected == result
Пример #28
0
def test_format_output_row_more_than_eight_authors_collaboration():
    with_collaboration = Record({
        'collaboration': [
            {'value': 'Supernova Search Team'}
        ]
    })
    latex = Latex(with_collaboration, 'latex_eu')

    expected = u'  A.~G.~Riess {{\\it et al.}} [Supernova Search Team Collaboration],\n'
    result = latex._format_output_row('author', [
        'A.~G.~Riess', 'A.~V.~Filippenko', 'P.~Challis', 'A.~Clocchiattia',
        'A.~Diercks', 'P.~M.~Garnavich', 'R.~L.~Gilliland', 'C.~J.~Hogan',
        'S.~Jha', 'R.~P.~Kirshner', 'B.~Leibundgut', 'M.~M.~Phillips',
        'D.~Reiss', 'B.~P.~Schmidt', 'R.~A.~Schommer', 'R.~C.~Smith',
        'J.~Spyromilio', 'C.~Stubbs', 'N.~B.~Suntzeff', 'J.~Tonry'
    ])

    assert expected == result
Пример #29
0
def test_format_output_row_publi_info_an_empty_list():
    record = Record({})
    latex = Latex(record, 'latex_eu')

    latex._format_output_row('publi_info', [])
Пример #30
0
def test_format_output_row_publi_info_an_empty_list():
    record = InspireRecord({})
    latex = Latex(record, 'latex_eu')

    latex._format_output_row('publi_info', [])