File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
stackinabox/util/requests_mock Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1717from requests .adapters import HTTPAdapter
1818from urllib3 .response import HTTPResponse
1919import requests_mock
20- import requests_mock .compat
2120import requests_mock .response
2221import six
2322
2423from stackinabox .stack import StackInABox
2524from stackinabox .util import deprecator
2625from stackinabox .util .requests_mock import reqcallable
2726
27+ try :
28+ import requests_mock .compat
29+ except ImportError :
30+ pass
31+
2832
2933logger = logging .getLogger (__name__ )
3034
@@ -52,6 +56,9 @@ def session_registration(uri, session):
5256 reqcallable .RequestMockCallable (uri )
5357 )
5458
59+ if not uri .endswith ('/' ):
60+ uri += '/'
61+
5562 # Tell the session about the adapter and the URI
5663 session .mount ('http://{0}' .format (uri ), StackInABox .hold_out ('adapter' ))
5764 session .mount ('https://{0}' .format (uri ), StackInABox .hold_out ('adapter' ))
You can’t perform that action at this time.
0 commit comments