search.services.index.tests.test_results module

Tests for search.services.index.

class search.services.index.tests.test_results.TestResultsEndSafely(methodName='runTest')[source]

Bases: unittest.case.TestCase

Given a highlighted abstract, find a safe end index for the preview.

setUp()[source]

Set a sample abstract for use in test cases.

test_end_safely_after_html_with_tolerance()[source]

End before HTML when desired fragment size would truncate.

test_end_safely_before_html()[source]

End before HTML when desired fragment size would truncate.

test_end_safely_before_texism()[source]

End before TeXism when desired fragment size would truncate.

test_end_safely_from_start()[source]

No TeXisms/HTML are found within the desired fragment size.

class search.services.index.tests.test_results.TestResultsHighlightAbstract(methodName='runTest')[source]

Bases: unittest.case.TestCase

Given a highlighted abstract, generate a safe preview.

setUp()[source]

Set a sample abstract for use in test cases.

test_preview()[source]

Generate a preview that is smaller than/equal to fragment size.

test_preview_with_close_highlights()[source]

Two highlights in the abstract are close together.