File tree 2 files changed +33
-0
lines changed
flowable/external_worker_client
2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ def __init__(
29
29
customize_session : Callable [[Session ], None ] = lambda session : None
30
30
) -> None :
31
31
self .flowable_host : str = flowable_host
32
+ if self .flowable_host .endswith ('/' ):
33
+ self .flowable_host = flowable_host [:- 1 ]
32
34
self .worker_id : str = worker_id
33
35
self .request_session : Session = requests .Session ()
34
36
if auth is not None :
Original file line number Diff line number Diff line change @@ -293,3 +293,34 @@ def test_job_with_cmmn_terminate(self):
293
293
294
294
finally :
295
295
self .remove_deployment ()
296
+
297
+ # this test is a bit special since it requires a context path.
298
+ # without context path this test will also succeed with a trailing slash
299
+ def test_with_trailing_slash_for_url (self ):
300
+ try :
301
+ client = restclient .FlowableExternalWorkerRestClient (
302
+ base_url + "/flowable-work/" ,
303
+ auth = auth ,
304
+ worker_id = 'test-worker'
305
+ )
306
+ with self .assertRaises (restclient .FlowableRestException ) as context :
307
+ client .list_jobs ()
308
+
309
+ self .assertEqual ("Failed to call Flowable with status code 404" , context .exception .args [0 ])
310
+ finally :
311
+ self .remove_deployment ()
312
+
313
+ # this test is a bit special since it requires a context path.
314
+ # without context path this test will also succeed with a trailing slash
315
+ def test_with_trailing_slash_for_url_with_200_as_result (self ):
316
+ try :
317
+ client = restclient .FlowableExternalWorkerRestClient (
318
+ base_url + "/" ,
319
+ auth = auth ,
320
+ worker_id = 'test-worker'
321
+ )
322
+
323
+ jobs = client .list_jobs ()
324
+ self .assertEqual (0 , jobs .total )
325
+ finally :
326
+ self .remove_deployment ()
You can’t perform that action at this time.
0 commit comments