當前位置: 首頁>>代碼示例>>Python>>正文


Python cv_latex.Cv_latex類代碼示例

本文整理匯總了Python中inspirehep.utils.cv_latex.Cv_latex的典型用法代碼示例。如果您正苦於以下問題:Python Cv_latex類的具體用法?Python Cv_latex怎麽用?Python Cv_latex使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Cv_latex類的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_parse_date_invalid_invenio_format

def test_parse_date_invalid_invenio_format():
    record = Record({})
    cv_latex = Cv_latex(record)

    expected = (1993, 2)
    result = cv_latex.parse_date('1993-02-ab')

    assert expected == result
開發者ID:nikpap,項目名稱:inspire-next,代碼行數:8,代碼來源:test_utils_cv_latex.py

示例2: test_parse_date_partial_spires_format_year_and_month

def test_parse_date_partial_spires_format_year_and_month():
    record = Record({})
    cv_latex = Cv_latex(record)

    expected = (1993, 2)
    result = cv_latex.parse_date('199302')

    assert expected == result
開發者ID:nikpap,項目名稱:inspire-next,代碼行數:8,代碼來源:test_utils_cv_latex.py

示例3: test_parse_date_full_spires_format

def test_parse_date_full_spires_format():
    record = Record({})
    cv_latex = Cv_latex(record)

    expected = (1993, 2, 2)
    result = cv_latex.parse_date('19930202')

    assert expected == result
開發者ID:nikpap,項目名稱:inspire-next,代碼行數:8,代碼來源:test_utils_cv_latex.py

示例4: test_parse_date_supports_unicode_strings

def test_parse_date_supports_unicode_strings():
    record = Record({})
    cv_latex = Cv_latex(record)

    expected = (1993, 2, 2)
    result = cv_latex.parse_date(u'1993-02-02')

    assert expected == result
開發者ID:nikpap,項目名稱:inspire-next,代碼行數:8,代碼來源:test_utils_cv_latex.py

示例5: test_parse_date_partial_spires_format_year_only

def test_parse_date_partial_spires_format_year_only():
    record = Record({})
    cv_latex = Cv_latex(record)

    expected = (1993,)
    result = cv_latex.parse_date('1993')

    assert expected == result
開發者ID:nikpap,項目名稱:inspire-next,代碼行數:8,代碼來源:test_utils_cv_latex.py

示例6: test_format_date_when_datestruct_has_three_elements

def test_format_date_when_datestruct_has_three_elements():
    record = Record({})
    cv_latex = Cv_latex(record)

    expected = 'Feb 2, 1993'
    result = cv_latex._format_date((1993, 2, 2))

    assert expected == result
開發者ID:nikpap,項目名稱:inspire-next,代碼行數:8,代碼來源:test_utils_cv_latex.py

示例7: test_format_date_when_datestruct_has_one_element

def test_format_date_when_datestruct_has_one_element():
    record = Record({})
    cv_latex = Cv_latex(record)

    expected = 1993
    result = cv_latex._format_date((1993,))

    assert expected == result
開發者ID:nikpap,項目名稱:inspire-next,代碼行數:8,代碼來源:test_utils_cv_latex.py

示例8: test_parse_date_full_invenio_format

def test_parse_date_full_invenio_format():
    record = InspireRecord({})
    cv_latex = Cv_latex(record)

    expected = (1993, 2, 2)
    result = cv_latex.parse_date('1993-02-02')

    assert expected == result
開發者ID:fschwenn,項目名稱:inspire-next,代碼行數:8,代碼來源:test_utils_cv_latex.py

示例9: test_parse_date_invalid_spires_format

def test_parse_date_invalid_spires_format():
    record = InspireRecord({})
    cv_latex = Cv_latex(record)

    expected = (1993, 2)
    result = cv_latex.parse_date('199302ab')

    assert expected == result
開發者ID:fschwenn,項目名稱:inspire-next,代碼行數:8,代碼來源:test_utils_cv_latex.py

示例10: test_format_date_when_datestruct_has_two_elements

def test_format_date_when_datestruct_has_two_elements():
    record = {}
    cv_latex = Cv_latex(record)

    expected = 'Feb 1993'
    result = cv_latex._format_date((1993, 2))

    assert expected == result
開發者ID:david-caro,項目名稱:inspire-next,代碼行數:8,代碼來源:test_utils_cv_latex.py

示例11: test_parse_date_returns_none_when_datetext_is_not_of_type_str

def test_parse_date_returns_none_when_datetext_is_not_of_type_str():
    record = Record({})
    cv_latex = Cv_latex(record)

    assert cv_latex.parse_date(0) is None
開發者ID:nikpap,項目名稱:inspire-next,代碼行數:5,代碼來源:test_utils_cv_latex.py

示例12: test_parse_date_returns_none_when_datetext_is_an_empty_string

def test_parse_date_returns_none_when_datetext_is_an_empty_string():
    record = Record({})
    cv_latex = Cv_latex(record)

    assert cv_latex.parse_date('') is None
開發者ID:nikpap,項目名稱:inspire-next,代碼行數:5,代碼來源:test_utils_cv_latex.py

示例13: test_parse_date_returns_none_when_datetext_is_none

def test_parse_date_returns_none_when_datetext_is_none():
    record = Record({})
    cv_latex = Cv_latex(record)

    assert cv_latex.parse_date(None) is None
開發者ID:nikpap,項目名稱:inspire-next,代碼行數:5,代碼來源:test_utils_cv_latex.py

示例14: test_format_date_returns_none_when_datestruct_has_four_elements

def test_format_date_returns_none_when_datestruct_has_four_elements():
    record = Record({})
    cv_latex = Cv_latex(record)

    assert cv_latex._format_date((1993, 2, 2, 1)) is None
開發者ID:nikpap,項目名稱:inspire-next,代碼行數:5,代碼來源:test_utils_cv_latex.py


注:本文中的inspirehep.utils.cv_latex.Cv_latex類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。