Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_server_error(self):
server = Server(config={'debug': True}, **config._sections['gateway'])
test = _Testing()
# Install two functions
func_desc_conn = self.conn.get_function_description("STFC_CONNECTION")
server.install_function(
func_desc_conn,
my_sftc_connection_error
)
with self.assertRaises(ABAPApplicationError) as run:
test.invoke_srv_function("STFC_CONNECTION", REQUTEXT="EXCEPTION")
self.assertEqual(run.exception.code, 5, "rc")
self.assertEqual(run.exception.key, "BAD_EXCEPTION_HAPPENED")
with self.assertRaises(ABAPApplicationError) as run:
test.invoke_srv_function("STFC_CONNECTION", REQUTEXT="EXCEPTION_MESSAGE")
def test_server(self):
server = Server(config={'debug': True}, **config._sections['gateway'])
test = _Testing()
# Install two functions
func_desc_conn = self.conn.get_function_description("STFC_CONNECTION")
server.install_function(
func_desc_conn,
my_stfc_connection
)
func_desc_chan = self.conn.get_function_description("STFC_CHANGING")
server.install_function(
func_desc_chan,
my_stfc_changing
)
# Lookup test
func_desc_invalid = test.get_srv_func_desc("NOT_VALID")