Example #1
0
 def test_contains(self):
     ex = BAPIError(self.bapiret, self.response)
     self.assertTrue(ex.bapiret.contains('ERR', '333'))
     self.assertFalse(ex.bapiret.contains('NOP', '222'))
Example #2
0
 def test_does_not_raise(self):
     BAPIError.raise_for_error([create_bapiret_warning(self.message_w)],
                               self.response)
Example #3
0
    def test_raises_for_error_with_instance(self):
        with self.assertRaises(BAPIError) as caught:
            BAPIError.raise_for_error(self.bapirettab[0], self.response)

        self.assertEqual(caught.exception.bapiret._bapirettab,
                         self.bapiret[0:1])
Example #4
0
    def test_raises_for_error(self):
        with self.assertRaises(BAPIError) as caught:
            BAPIError.raise_for_error(self.bapirettab, self.response)

        self.assertExDataMatch(caught.exception)
Example #5
0
 def test_ctor_join_list(self):
     ex = BAPIError(self.bapiret, self.response)
     self.assertExDataMatch(ex)
Example #6
0
 def _call_bapi_method(self, connection, method_name, kwargs):
     resp = connection.call(method_name, **kwargs)
     BAPIError.raise_for_error(resp['RETURN'], resp)
     return resp