def test_contains(self): ex = BAPIError(self.bapiret, self.response) self.assertTrue(ex.bapiret.contains('ERR', '333')) self.assertFalse(ex.bapiret.contains('NOP', '222'))
def test_does_not_raise(self): BAPIError.raise_for_error([create_bapiret_warning(self.message_w)], self.response)
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])
def test_raises_for_error(self): with self.assertRaises(BAPIError) as caught: BAPIError.raise_for_error(self.bapirettab, self.response) self.assertExDataMatch(caught.exception)
def test_ctor_join_list(self): ex = BAPIError(self.bapiret, self.response) self.assertExDataMatch(ex)
def _call_bapi_method(self, connection, method_name, kwargs): resp = connection.call(method_name, **kwargs) BAPIError.raise_for_error(resp['RETURN'], resp) return resp