search.controllers.tests module

Tests for search.controllers.

class search.controllers.tests.TestHealthCheck(methodName='runTest')[source]

Bases: unittest.case.TestCase

Tests for health_check().

test_index_is_down(mock_index)[source]

Test returns ‘DOWN’ + status 500 when index raises an exception.

test_index_returns_no_result(mock_index)[source]

Test returns ‘DOWN’ + status 500 when index returns no results.

test_index_returns_result(mock_index)[source]

Test returns ‘OK’ + status 200 when index returns results.

class search.controllers.tests.TestUnderscoreHandling(methodName='runTest')[source]

Bases: unittest.case.TestCase

Test catch_underscore_syntax().

test_false_positive()[source]

The underscore is followed by more than one character.

test_multiple_authors()[source]

The user passes more than one name in classic format.

test_nonsense_input()[source]

Garbage input is passed.

test_underscore_is_rewritten()[source]

User searches for an author name with surname_f format.