Skip to content

Commit e3beecf

Browse files
use a locally hosted elastcsearch for SSL tests
1 parent 840f87d commit e3beecf

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ jobs:
6161
image: kennethreitz/httpbin
6262
ports:
6363
- 8080:80
64+
elasticsearch:
65+
image: docker.elastic.co/elasticsearch/elasticsearch:9.0.2
66+
env:
67+
discovery.type: single-node
68+
ports:
69+
9200:9200
6470
steps:
6571
- name: Checkout repository
6672
uses: actions/checkout@v2

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ async def perform_request(self, *args, **kwargs):
6969
@pytest.fixture(scope="session", params=[True, False])
7070
def httpbin_cert_fingerprint(request) -> str:
7171
"""Gets the SHA256 fingerprint of the certificate for 'httpbin.org'"""
72-
sock = socket.create_connection(("httpbin.org", 443))
72+
sock = socket.create_connection(("localhost", 9200))
7373
ctx = ssl.create_default_context()
7474
ctx.check_hostname = False
7575
ctx.verify_mode = ssl.CERT_NONE

tests/node/test_http_aiohttp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,8 @@ async def test_ssl_assert_fingerprint(httpbin_cert_fingerprint):
295295
node = AiohttpHttpNode(
296296
NodeConfig(
297297
scheme="https",
298-
host="httpbin.org",
299-
port=443,
298+
host="localhost",
299+
port=9200,
300300
ssl_assert_fingerprint=httpbin_cert_fingerprint,
301301
)
302302
)

tests/node/test_http_httpx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ def test_ssl_assert_fingerprint(httpbin_cert_fingerprint):
150150
HttpxAsyncHttpNode(
151151
NodeConfig(
152152
scheme="https",
153-
host="httpbin.org",
154-
port=443,
153+
host="localhost",
154+
port=9200,
155155
ssl_assert_fingerprint=httpbin_cert_fingerprint,
156156
)
157157
)

0 commit comments

Comments
 (0)