def test_catch_index_error_not_index_error(self): conn = ESHttpConnection() try: conn._catch_index_error(( 1, 2, '{"errors":true, "items": [{"foo": "bar"}]}')) except: raise Exception('Unexpected exeption')
def test_catch_index_error(self): conn = ESHttpConnection() with pytest.raises(JHTTPBadRequest): conn._catch_index_error(( 1, 2, '{"errors":true, "items": [{"index": {"error": "FOO"}}]}'))
def test_catch_index_error_no_errors(self): conn = ESHttpConnection() try: conn._catch_index_error((1, 2, '{"errors":false}')) except: raise Exception('Unexpected exeption')
def test_catch_index_error_no_data_loaded(self): conn = ESHttpConnection() try: conn._catch_index_error((1, 2, '[]')) except: raise Exception('Unexpected exeption')