def test_multiple_alias_exception_detection(self):
        alias_exc = es_exceptions.RequestError(
            400, "Something " + helper.ALIAS_EXCEPTION_STRING, {})
        self.assertTrue(helper._is_multiple_alias_exception(alias_exc))

        other_exc = Exception("Blah blah")
        self.assertFalse(helper._is_multiple_alias_exception(other_exc))
예제 #2
0
    def test_multiple_alias_exception_detection(self):
        alias_exc = es_exceptions.RequestError(
            400, "Something " + helper.ALIAS_EXCEPTION_STRING, {})
        self.assertTrue(helper._is_multiple_alias_exception(alias_exc))

        other_exc = Exception("Blah blah")
        self.assertFalse(helper._is_multiple_alias_exception(other_exc))
예제 #3
0
 def test_multiple_alias_exception_elasticsearch2(self):
     # The es-2 format is different
     alias_exc = es_exceptions.RequestError(
         400,
         'illegal_argument_exception',
         {"error": {
             "root_cause": [{
                 "type": "illegal_argument_exception",
                 "reason": "Something " + helper.ALIAS_EXCEPTION_STRING
             }],
             "type": "illegal_argument_exception",
             "reason": "Something " + helper.ALIAS_EXCEPTION_STRING
         }})
     self.assertTrue(helper._is_multiple_alias_exception(alias_exc))
예제 #4
0
 def test_multiple_alias_exception_elasticsearch2(self):
     # The es-2 format is different
     alias_exc = es_exceptions.RequestError(
         400,
         'illegal_argument_exception',
         {"error": {
             "root_cause": [{
                 "type": "illegal_argument_exception",
                 "reason": "Something " + helper.ALIAS_EXCEPTION_STRING
             }],
             "type": "illegal_argument_exception",
             "reason": "Something " + helper.ALIAS_EXCEPTION_STRING
         }})
     self.assertTrue(helper._is_multiple_alias_exception(alias_exc))