本文整理匯總了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
示例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
示例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
示例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
示例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
示例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
示例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
示例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
示例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
示例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
示例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
示例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
示例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
示例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