コード例 #1
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))
コード例 #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))