Пример #1
0
def test_get_author_from_authors_an_empty_list():
    authors_an_empty_list = Record({'authors': []})
    latex = Latex(authors_an_empty_list, 'latex_eu')

    expected = []
    result = latex._get_author()

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

    expected = []
    result = latex._get_author()

    assert expected == result
Пример #3
0
def test_get_author_from_authors_an_empty_list():
    authors_an_empty_list = InspireRecord({'authors': []})
    latex = Latex(authors_an_empty_list, 'latex_eu')

    expected = []
    result = latex._get_author()

    assert expected == result
Пример #4
0
def test_get_author_from_corporate_author_an_empty_list():
    corporate_author_an_empty_list = InspireRecord({'corporate_author': []})
    latex = Latex(corporate_author_an_empty_list, 'latex_eu')

    expected = []
    result = latex._get_author()

    assert expected == result
Пример #5
0
def test_get_author_from_corporate_author_a_list_with_two_elements():
    corporate_author_a_list_of_two_elements = InspireRecord(
        {'corporate_author': ['CMS Collaboration', 'The ATLAS Collaboration']})
    latex = Latex(corporate_author_a_list_of_two_elements, 'latex_eu')

    expected = ['CMS Collaboration', 'The ATLAS Collaboration']
    result = latex._get_author()

    assert expected == result
Пример #6
0
def test_get_author_from_corporate_author_a_list_with_one_element():
    corporate_author_a_list_of_one_element = Record(
        {'corporate_author': ['CMS Collaboration']})
    latex = Latex(corporate_author_a_list_of_one_element, 'latex_eu')

    expected = ['CMS Collaboration']
    result = latex._get_author()

    assert expected == result
Пример #7
0
def test_get_author_from_authors_one_author_with_an_empty_list_of_full_names():
    one_author_with_an_empty_list_of_full_names = InspireRecord(
        {'authors': [{
            'full_name': []
        }]})
    latex = Latex(one_author_with_an_empty_list_of_full_names, 'latex_eu')

    expected = []
    result = latex._get_author()

    assert expected == result
Пример #8
0
def test_get_author_from_authors_a_list_with_one_element():
    authors_a_list_with_one_element = InspireRecord(
        {'authors': [{
            'full_name': 'Glashow, S.L.'
        }]})
    latex = Latex(authors_a_list_with_one_element, 'latex_eu')

    expected = ['S.~L.~Glashow']
    result = latex._get_author()

    assert expected == result
Пример #9
0
def test_get_author_from_authors_one_author_with_a_list_of_one_full_name():
    one_author_with_a_list_of_one_full_name = InspireRecord(
        {'authors': [{
            'full_name': ['Glashow, S.L.']
        }]})
    latex = Latex(one_author_with_a_list_of_one_full_name, 'latex_eu')

    expected = ['S.~L.~Glashow']
    result = latex._get_author()

    assert expected == result
Пример #10
0
def test_get_author_from_authors_one_author_with_a_list_of_two_full_names():
    one_author_with_a_list_of_two_full_names = InspireRecord(
        {'authors': [{
            'full_name': ['Englert, F.', 'Brout, R.']
        }]})
    latex = Latex(one_author_with_a_list_of_two_full_names, 'latex_eu')

    expected = ['F.~B.~Englert, R.']
    result = latex._get_author()

    assert expected == result
Пример #11
0
def test_get_author_from_authors_one_author_with_an_empty_list_of_full_names():
    one_author_with_an_empty_list_of_full_names = Record({
        'authors': [
            {'full_name': []}
        ]
    })
    latex = Latex(one_author_with_an_empty_list_of_full_names, 'latex_eu')

    expected = []
    result = latex._get_author()

    assert expected == result
Пример #12
0
def test_get_author_from_corporate_author_a_list_with_one_element():
    corporate_author_a_list_of_one_element = Record({
        'corporate_author': [
            'CMS Collaboration'
        ]
    })
    latex = Latex(corporate_author_a_list_of_one_element, 'latex_eu')

    expected = ['CMS Collaboration']
    result = latex._get_author()

    assert expected == result
Пример #13
0
def test_get_author_from_authors_one_author_with_a_list_of_one_full_name():
    one_author_with_a_list_of_one_full_name = Record({
        'authors': [
            {'full_name': ['Glashow, S.L.']}
        ]
    })
    latex = Latex(one_author_with_a_list_of_one_full_name, 'latex_eu')

    expected = ['S.~L.~Glashow']
    result = latex._get_author()

    assert expected == result
Пример #14
0
def test_get_author_from_authors_a_list_with_one_element():
    authors_a_list_with_one_element = Record({
        'authors': [
            {'full_name': 'Glashow, S.L.'}
        ]
    })
    latex = Latex(authors_a_list_with_one_element, 'latex_eu')

    expected = ['S.~L.~Glashow']
    result = latex._get_author()

    assert expected == result
Пример #15
0
def test_get_author_from_authors_a_list_with_two_elements():
    authors_a_list_with_two_elements = InspireRecord({
        'authors': [
            {'full_name': 'Englert, F.'},
            {'full_name': 'Brout, R.'}
        ]
    })
    latex = Latex(authors_a_list_with_two_elements, 'latex_eu')

    expected = ['F.~Englert', 'R.~Brout']
    result = latex._get_author()

    assert expected == result
Пример #16
0
def test_get_author_from_corporate_author_a_list_with_two_elements():
    corporate_author_a_list_of_two_elements = Record({
        'corporate_author': [
            'CMS Collaboration',
            'The ATLAS Collaboration'
        ]
    })
    latex = Latex(corporate_author_a_list_of_two_elements, 'latex_eu')

    expected = ['CMS Collaboration', 'The ATLAS Collaboration']
    result = latex._get_author()

    assert expected == result
Пример #17
0
def test_get_author_from_authors_a_list_with_two_elements():
    authors_a_list_with_two_elements = Record({
        'authors': [
            {'full_name': 'Englert, F.'},
            {'full_name': 'Brout, R.'}
        ]
    })
    latex = Latex(authors_a_list_with_two_elements, 'latex_eu')

    expected = ['F.~Englert', 'R.~Brout']
    result = latex._get_author()

    assert expected == result
Пример #18
0
def test_get_author_from_authors_one_author_with_a_list_of_two_full_names():
    one_author_with_a_list_of_two_full_names = Record({
        'authors': [
            {
                'full_name': [
                    'Englert, F.',
                    'Brout, R.'
                ]
            }
        ]
    })
    latex = Latex(one_author_with_a_list_of_two_full_names, 'latex_eu')

    expected = ['F.~B.~Englert, R.']
    result = latex._get_author()

    assert expected == result