@@ -43,6 +43,7 @@ def my_stfc_connection(request_context=None, REQUTEXT=""):
43
43
44
44
client = Connection (dest = "MME" )
45
45
46
+
46
47
@pytest .mark .skipif (not sys .platform .startswith ("darwin" ), reason = "Manual server test on Darwin only" )
47
48
class TestServer :
48
49
def test_add_wrong_function (self ):
@@ -84,7 +85,6 @@ def test_function_description_BS01_SALESORDER_GETDETAIL(self):
84
85
FUNC_DESC_BS01_SALESORDER_GETDETAIL ,
85
86
)
86
87
87
-
88
88
def test_stfc_structure (self ):
89
89
def my_stfc_structure (request_context = None , IMPORTSTRUCT = None , RFCTABLE = None ):
90
90
"""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):
96
96
if RFCTABLE is None :
97
97
RFCTABLE = []
98
98
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
102
102
if len (RFCTABLE ) == 0 :
103
103
RFCTABLE = [ECHOSTRUCT ]
104
104
RESPTEXT = f"Python server sends { len (RFCTABLE )} table rows"
@@ -108,7 +108,6 @@ def my_stfc_structure(request_context=None, IMPORTSTRUCT=None, RFCTABLE=None):
108
108
109
109
return {"ECHOSTRUCT" : ECHOSTRUCT , "RFCTABLE" : RFCTABLE , "RESPTEXT" : RESPTEXT }
110
110
111
-
112
111
def my_auth_check (func_name = False , request_context = None ):
113
112
"""Server authorization check."""
114
113
@@ -122,9 +121,7 @@ def my_auth_check(func_name=False, request_context=None):
122
121
123
122
# create server
124
123
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 }
128
125
)
129
126
130
127
# 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):
152
149
# shutdown server
153
150
server .close ()
154
151
152
+
155
153
# get server attributes
156
154
print (server .get_server_attributes ())
157
155
156
+
158
157
def teardown ():
159
158
server .close ()
0 commit comments