get_field_content_in_utf8(6, 'abstract', tags))

    @nottest
    def test_build_custom_field_content(self):
        """solrutils - build custom field content"""
        tags = {'abstract': ['520__%', '590__%']}

        self.assertEqual(u"""In 1962, CERN hosted the 11th International Conference on High Energy Physics. Among the distinguished visitors were eight Nobel prizewinners.Left to right: Cecil F. Powell, Isidor I. Rabi, Werner Heisenberg, Edwin M. McMillan, Emile Segre, Tsung Dao Lee, Chen Ning Yang and Robert Hofstadter. En 1962, le CERN est l'hote de la onzieme Conference Internationale de Physique des Hautes Energies. Parmi les visiteurs eminents se trouvaient huit laureats du prix Nobel.De gauche a droite: Cecil F. Powell, Isidor I. Rabi, Werner Heisenberg, Edwin M. McMillan, Emile Segre, Tsung Dao Lee, Chen Ning Yang et Robert Hofstadter.""",
                         get_field_content_in_utf8(6, 'abstract', tags))


TESTS = []


if CFG_SOLR_URL:
    TESTS.extend((TestSolrSearch, TestSolrWebSearch))
    if get_external_word_similarity_ranker() == 'solr':
        TESTS.extend((TestSolrRanking,
                      TestSolrSimilarToRecid,
                      TestSolrWebRanking,
                      TestSolrWebSimilarToRecid,
                      TestSolrLoadLogicalFieldSettings,
                      TestSolrBuildFieldContent,
                      ))


TEST_SUITE = make_test_suite(*TESTS)

if __name__ == "__main__":
    run_test_suite(TEST_SUITE, warn_user=True)
        test_case_repno_cited_by = []
        self.assertEqual(self._detect_extcite_info(test_case_repno),
                         test_case_repno_cited_by)

    def test_intcite_via_publication_reference(self):
        """bibrank - external cites, no internal papers via publication reference"""
        # The internal paper #18 has only pubinfo, no repno, and is
        # cited by internal paper #96 via its pubinfo, so should not
        # be present in the extcite list:
        test_case_repno = "Phys. Lett., B 151 (1985) 357"
        test_case_repno_cited_by = []
        self.assertEqual(self._detect_extcite_info(test_case_repno),
                         test_case_repno_cited_by)


TESTS = [BibRankWebPagesAvailabilityTest,
         BibRankIntlMethodNames,
         BibRankCitationRankingTest,
         BibRankExtCitesTest]


if not get_external_word_similarity_ranker():
    TESTS.append(BibRankWordSimilarityRankingTest)


TEST_SUITE = make_test_suite(*TESTS)


if __name__ == "__main__":
    run_test_suite(TEST_SUITE, warn_user=True)
            get_field_content_in_utf8(6, 'abstract', tags))

    @nottest
    def test_build_custom_field_content(self):
        """solrutils - build custom field content"""
        tags = {'abstract': ['520__%', '590__%']}

        self.assertEqual(
            u"""In 1962, CERN hosted the 11th International Conference on High Energy Physics. Among the distinguished visitors were eight Nobel prizewinners.Left to right: Cecil F. Powell, Isidor I. Rabi, Werner Heisenberg, Edwin M. McMillan, Emile Segre, Tsung Dao Lee, Chen Ning Yang and Robert Hofstadter. En 1962, le CERN est l'hote de la onzieme Conference Internationale de Physique des Hautes Energies. Parmi les visiteurs eminents se trouvaient huit laureats du prix Nobel.De gauche a droite: Cecil F. Powell, Isidor I. Rabi, Werner Heisenberg, Edwin M. McMillan, Emile Segre, Tsung Dao Lee, Chen Ning Yang et Robert Hofstadter.""",
            get_field_content_in_utf8(6, 'abstract', tags))


TESTS = []

if CFG_SOLR_URL:
    TESTS.extend((TestSolrSearch, TestSolrWebSearch))
    if get_external_word_similarity_ranker() == 'solr':
        TESTS.extend((
            TestSolrRanking,
            TestSolrSimilarToRecid,
            TestSolrWebRanking,
            TestSolrWebSimilarToRecid,
            TestSolrLoadLogicalFieldSettings,
            TestSolrBuildFieldContent,
        ))

TEST_SUITE = make_test_suite(*TESTS)

if __name__ == "__main__":
    run_test_suite(TEST_SUITE, warn_user=True)
def create_external_word_similarity_ranker_tests():
    from invenio.bibrank_bridge_utils import get_external_word_similarity_ranker
    if not get_external_word_similarity_ranker():
        TESTS.append(BibRankWordSimilarityRankingTest)
Example #5
0
        test_case_repno_cited_by = []
        self.assertEqual(self._detect_extcite_info(test_case_repno),
                         test_case_repno_cited_by)

    def test_intcite_via_publication_reference(self):
        """bibrank - external cites, no internal papers via publication reference"""
        # The internal paper #18 has only pubinfo, no repno, and is
        # cited by internal paper #96 via its pubinfo, so should not
        # be present in the extcite list:
        test_case_repno = "Phys. Lett., B 151 (1985) 357"
        test_case_repno_cited_by = []
        self.assertEqual(self._detect_extcite_info(test_case_repno),
                         test_case_repno_cited_by)


TESTS = [BibRankWebPagesAvailabilityTest,
         BibRankIntlMethodNames,
         BibRankCitationRankingTest,
         BibRankExtCitesTest]


if not get_external_word_similarity_ranker():
    TESTS.append(BibRankWordSimilarityRankingTest)


TEST_SUITE = make_test_suite(*TESTS)


if __name__ == "__main__":
    run_test_suite(TEST_SUITE, warn_user=True)