Closed gregbrowndev closed 2 years ago
Hi @gregbrowndev, thanks for opening this issue.
I don't think it has been tested before, but we should be able to make it work.
I believe It's calling a method that I am not defining on FakeSSLContext
side.
You could try to add set_ciphers
to this tuple.
If you don't want to or cannot try, I'll give it a shot when I am done with work.
It may fail for a similar reason after you add that one, the fix would still be adding what's missing. I hope you won't see anything worse than that.
Thanks, @mindflayer, for the quick response on this!
I'll struggle to be able to try it today because I have plans after work. I'll try to investigate when I get the chance.
I tried the fix and it worked, but it looks like there is something more profound I have to investigate.
Here is a new version supporting httpx
: https://pypi.org/project/mocket/3.10.7/
Hi,
I'm in the process of converting my requests-based application to httpx, and therefore also having to convert all the responses-based mocks within my tests. I wanted to avoid coupling to another client-specific test library like RESPX and instead use mocket.
However, I get an error when trying to instantiate httpx's
AsyncClient
. Here's a simple async pytest:Stacktrack
``` tests/adapters/junifer/client/test_mocket.py:7 (test_mocket) @async_mocketize async def test_mocket(): > async with httpx.AsyncClient() as client: test_mocket.py:10: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /Users/gregorybrown/Library/Caches/pypoetry/virtualenvs/tariff-management-6yv2RoDp-py3.10/lib/python3.10/site-packages/httpx/_client.py:1394: in __init__ self._transport = self._init_transport( /Users/gregorybrown/Library/Caches/pypoetry/virtualenvs/tariff-management-6yv2RoDp-py3.10/lib/python3.10/site-packages/httpx/_client.py:1442: in _init_transport return AsyncHTTPTransport( /Users/gregorybrown/Library/Caches/pypoetry/virtualenvs/tariff-management-6yv2RoDp-py3.10/lib/python3.10/site-packages/httpx/_transports/default.py:261: in __init__ ssl_context = create_ssl_context(verify=verify, cert=cert, trust_env=trust_env) /Users/gregorybrown/Library/Caches/pypoetry/virtualenvs/tariff-management-6yv2RoDp-py3.10/lib/python3.10/site-packages/httpx/_config.py:49: in create_ssl_context return SSLConfig( /Users/gregorybrown/Library/Caches/pypoetry/virtualenvs/tariff-management-6yv2RoDp-py3.10/lib/python3.10/site-packages/httpx/_config.py:73: in __init__ self.ssl_context = self.load_ssl_context() /Users/gregorybrown/Library/Caches/pypoetry/virtualenvs/tariff-management-6yv2RoDp-py3.10/lib/python3.10/site-packages/httpx/_config.py:85: in load_ssl_context return self.load_ssl_context_verify() /Users/gregorybrown/Library/Caches/pypoetry/virtualenvs/tariff-management-6yv2RoDp-py3.10/lib/python3.10/site-packages/httpx/_config.py:122: in load_ssl_context_verify context = self._create_default_ssl_context() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self =Is httpx not supported? There are no references to it in the source or docs.
Thanks!