예제 #1
0
def test_get_title_from_titles_an_empty_list():
    titles_an_empty_list = InspireRecord({'titles': []})
    latex = Latex(titles_an_empty_list, 'latex_eu')

    expected = ''
    result = latex._get_title()

    assert expected == result
예제 #2
0
def test_get_title_from_titles_an_empty_list():
    titles_an_empty_list = Record({'titles': []})
    latex = Latex(titles_an_empty_list, 'latex_eu')

    expected = ''
    result = latex._get_title()

    assert expected == result
예제 #3
0
def test_get_title_no_titles():
    no_titles = InspireRecord({})
    latex = Latex(no_titles, 'latex_eu')

    expected = ''
    result = latex._get_title()

    assert expected == result
예제 #4
0
def test_get_title_no_titles():
    no_titles = Record({})
    latex = Latex(no_titles, 'latex_eu')

    expected = ''
    result = latex._get_title()

    assert expected == result
예제 #5
0
def test_get_title_no_titles():
    no_titles = {}
    latex = Latex(no_titles, 'latex_eu')

    expected = ''
    result = latex._get_title()

    assert expected == result
예제 #6
0
def test_get_title_from_titles_not_a_list():
    titles_not_a_list = InspireRecord(
        {'titles': {
            'title': 'Partial Symmetries of Weak Interactions'
        }})
    latex = Latex(titles_not_a_list, 'latex_eu')

    expected = 'Partial Symmetries of Weak Interactions'
    result = latex._get_title()

    assert expected == result
예제 #7
0
def test_get_title_from_titles_a_list_with_one_element():
    titles_a_list_with_one_element = InspireRecord(
        {'titles': [{
            'title': 'Partial Symmetries of Weak Interactions'
        }]})
    latex = Latex(titles_a_list_with_one_element, 'latex_eu')

    expected = 'Partial Symmetries of Weak Interactions'
    result = latex._get_title()

    assert expected == result
예제 #8
0
def test_get_title_from_titles_not_a_list():
    titles_not_a_list = Record({
        'titles': {
            'title': 'Partial Symmetries of Weak Interactions'
        }
    })
    latex = Latex(titles_not_a_list, 'latex_eu')

    expected = 'Partial Symmetries of Weak Interactions'
    result = latex._get_title()

    assert expected == result
예제 #9
0
def test_get_title_from_titles_a_list_with_one_element():
    titles_a_list_with_one_element = Record({
        'titles': [
            {'title': 'Partial Symmetries of Weak Interactions'}
        ]
    })
    latex = Latex(titles_a_list_with_one_element, 'latex_eu')

    expected = 'Partial Symmetries of Weak Interactions'
    result = latex._get_title()

    assert expected == result
예제 #10
0
def test_get_title_from_titles_a_list_with_two_elements():
    titles_a_list_with_two_elements = InspireRecord({
        'titles': [
            {'title': 'Broken Symmetries and the Masses of Gauge Bosons'},
            {'title': 'BROKEN SYMMETRIES AND THE MASSES OF GAUGE BOSONS.'}
        ]
    })
    latex = Latex(titles_a_list_with_two_elements, 'latex_eu')

    expected = 'Broken Symmetries and the Masses of Gauge Bosons'
    result = latex._get_title()

    assert expected == result
예제 #11
0
def test_get_title_from_titles_a_list_with_two_elements():
    titles_a_list_with_two_elements = Record({
        'titles': [
            {'title': 'Broken Symmetries and the Masses of Gauge Bosons'},
            {'title': 'BROKEN SYMMETRIES AND THE MASSES OF GAUGE BOSONS.'}
        ]
    })
    latex = Latex(titles_a_list_with_two_elements, 'latex_eu')

    expected = 'Broken Symmetries and the Masses of Gauge Bosons'
    result = latex._get_title()

    assert expected == result