@@ -43,6 +43,7 @@ def my_stfc_connection(request_context=None, REQUTEXT=""):
4343
4444client = Connection (dest = "MME" )
4545
46+
4647@pytest .mark .skipif (not sys .platform .startswith ("darwin" ), reason = "Manual server test on Darwin only" )
4748class TestServer :
4849 def test_add_wrong_function (self ):
@@ -84,7 +85,6 @@ def test_function_description_BS01_SALESORDER_GETDETAIL(self):
8485 FUNC_DESC_BS01_SALESORDER_GETDETAIL ,
8586 )
8687
87-
8888 def test_stfc_structure (self ):
8989 def my_stfc_structure (request_context = None , IMPORTSTRUCT = None , RFCTABLE = None ):
9090 """Server function my_stfc_structure with the signature of ABAP function module STFC_STRUCTURE."""
@@ -96,9 +96,9 @@ def my_stfc_structure(request_context=None, IMPORTSTRUCT=None, RFCTABLE=None):
9696 if RFCTABLE is None :
9797 RFCTABLE = []
9898 ECHOSTRUCT = IMPORTSTRUCT .copy ()
99- ECHOSTRUCT [' RFCINT1' ] += 1
100- ECHOSTRUCT [' RFCINT2' ] += 1
101- ECHOSTRUCT [' RFCINT4' ] += 1
99+ ECHOSTRUCT [" RFCINT1" ] += 1
100+ ECHOSTRUCT [" RFCINT2" ] += 1
101+ ECHOSTRUCT [" RFCINT4" ] += 1
102102 if len (RFCTABLE ) == 0 :
103103 RFCTABLE = [ECHOSTRUCT ]
104104 RESPTEXT = f"Python server sends { len (RFCTABLE )} table rows"
@@ -108,7 +108,6 @@ def my_stfc_structure(request_context=None, IMPORTSTRUCT=None, RFCTABLE=None):
108108
109109 return {"ECHOSTRUCT" : ECHOSTRUCT , "RFCTABLE" : RFCTABLE , "RESPTEXT" : RESPTEXT }
110110
111-
112111 def my_auth_check (func_name = False , request_context = None ):
113112 """Server authorization check."""
114113
@@ -122,9 +121,7 @@ def my_auth_check(func_name=False, request_context=None):
122121
123122 # create server
124123 server = Server (
125- {"dest" : "MME_GATEWAY" },
126- {"dest" : "MME" },
127- {"check_date" : False , "check_time" : False , "server_log" : True }
124+ {"dest" : "MME_GATEWAY" }, {"dest" : "MME" }, {"check_date" : False , "check_time" : False , "server_log" : True }
128125 )
129126
130127 # expose python function my_stfc_structure as ABAP function STFC_STRUCTURE, to be called by ABAP system
@@ -152,8 +149,10 @@ def my_auth_check(func_name=False, request_context=None):
152149 # shutdown server
153150 server .close ()
154151
152+
155153# get server attributes
156154print (server .get_server_attributes ())
157155
156+
158157def teardown ():
159158 server .close ()
0 commit comments