How to use the pyrfc._pyrfc._Testing function in pyrfc

To help you get started, we’ve selected a few pyrfc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SAP / PyRFC / material / test_server.py View on Github external
def test_func_desc_auto(self):
        test = _Testing()
        func_desc = self.conn.get_function_description("STFC_STRUCTURE")
        func_desc2 = test.fill_and_wrap_function_description(func_desc)

        self.assertEqual(pickle.dumps(func_desc), pickle.dumps(func_desc2))
github SAP / PyRFC / material / test_server.py View on Github external
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")
        self.assertEqual(run.exception.code, 5, "rc")
github SAP / PyRFC / material / test_server.py View on Github external
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")
        self.assertEqual(func_desc_invalid, 17, "Return code for unknown func_desc should be RFC_NOT_FOUND (17).")