예제 #1
0
 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')
예제 #2
0
 def test_catch_index_error(self):
     conn = ESHttpConnection()
     with pytest.raises(JHTTPBadRequest):
         conn._catch_index_error((
             1, 2,
             '{"errors":true, "items": [{"index": {"error": "FOO"}}]}'))
예제 #3
0
 def test_catch_index_error_no_errors(self):
     conn = ESHttpConnection()
     try:
         conn._catch_index_error((1, 2, '{"errors":false}'))
     except:
         raise Exception('Unexpected exeption')
예제 #4
0
 def test_catch_index_error_no_data_loaded(self):
     conn = ESHttpConnection()
     try:
         conn._catch_index_error((1, 2, '[]'))
     except:
         raise Exception('Unexpected exeption')