Example #1
0
 def test_should_parse_single_doxygen_cite_reference(self):
     assert parse_plain_text_references(r'\\cite ' +
                                        REF_NAME_1) == [REF_NAME_1]
Example #2
0
 def test_should_parse_multiple_latex_cite_reference(self):
     assert parse_plain_text_references(r'\\cite{' + REF_NAME_1 + ', ' +
                                        REF_NAME_2 +
                                        r'}') == [REF_NAME_1, REF_NAME_2]
Example #3
0
 def test_should_parse_latex_cite_reference_with_page_number(self):
     assert parse_plain_text_references(r'\\cite[p.~215]{' + REF_NAME_1 +
                                        r'}') == [REF_NAME_1]
Example #4
0
 def test_should_parse_multiple_sphinx_cite_references(self):
     assert parse_plain_text_references(r'See :cite:`' + REF_NAME_1 + ', ' +
                                        REF_NAME_2 +
                                        r'` for an introduction') == [
                                            REF_NAME_1, REF_NAME_2
                                        ]
Example #5
0
 def test_should_parse_single_latex_cite_reference(self):
     assert parse_plain_text_references(r'\\cite{' + REF_NAME_1 +
                                        r'}') == [REF_NAME_1]
Example #6
0
 def test_should_parse_doi_https_url(self):
     assert parse_plain_text_references(DOI_URL_HTTP_PREFIX + DOI_1) == [
         DOI_URL_HTTPS_PREFIX + DOI_1
     ]
Example #7
0
 def test_should_parse_doi_with_surround_text(self):
     assert parse_plain_text_references('DOI: ' + DOI_1 +
                                        ' used for xyz') == [
                                            DOI_URL_HTTPS_PREFIX + DOI_1
                                        ]
Example #8
0
 def test_should_parse_doi_without_additional_text(self):
     assert parse_plain_text_references(DOI_1) == [
         DOI_URL_HTTPS_PREFIX + DOI_1
     ]
Example #9
0
 def test_should_return_empty_list_for_text_without_reference(self):
     assert parse_plain_text_references(
         'description of some function') == []
Example #10
0
 def test_should_return_empty_list_for_empty_string(self):
     assert parse_plain_text_references('') == []