Skip to content

Commit 6402e2b

Browse files
committed
chore: updated tests to use httpx client
1 parent c34b073 commit 6402e2b

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

tests/integration/key_value_store.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from typing import TYPE_CHECKING
66

77
import httpx
8-
import requests
98
from integration_test_utils import random_resource_name
109

1110
if TYPE_CHECKING:
@@ -27,13 +26,15 @@ def test_key_value_store_should_create_public_keys_expiring_url_with_params(
2726
assert 'signature=' in keys_public_url
2827
assert 'limit=10' in keys_public_url
2928

30-
response = requests.get(keys_public_url, timeout=5)
29+
httpx_client = httpx.Client()
30+
response = httpx_client.get(keys_public_url, timeout=5)
3131
assert response.status_code == 200
3232

3333
time.sleep(3)
3434

3535
# Assert that the request is now forbidden (expired signature)
36-
response_after_expiry = requests.get(keys_public_url, timeout=5)
36+
httpx_client = httpx.Client()
37+
response_after_expiry = httpx_client.get(keys_public_url, timeout=5)
3738
assert response_after_expiry.status_code == 403
3839

3940
store.delete()
@@ -47,7 +48,8 @@ def test_key_value_store_should_create_public_keys_non_expiring_url(self, apify_
4748

4849
assert 'signature=' in keys_public_url
4950

50-
response = requests.get(keys_public_url, timeout=5)
51+
httpx_client = httpx.Client()
52+
response = httpx_client.get(keys_public_url, timeout=5)
5153
assert response.status_code == 200
5254

5355
store.delete()

tests/integration/test_dataset.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from typing import TYPE_CHECKING
66

77
import httpx
8-
import requests
98
from integration_test_utils import random_resource_name
109

1110
if TYPE_CHECKING:
@@ -27,13 +26,15 @@ def test_dataset_should_create_public_items_expiring_url_with_params(self, apify
2726
assert 'limit=10' in items_public_url
2827
assert 'offset=0' in items_public_url
2928

30-
response = requests.get(items_public_url, timeout=5)
29+
httpx_client = httpx.Client()
30+
response = httpx_client.get(items_public_url, timeout=5)
3131
assert response.status_code == 200
3232

3333
time.sleep(3)
3434

3535
# Assert that the request is now forbidden (expired signature)
36-
response_after_expiry = requests.get(items_public_url, timeout=5)
36+
httpx_client = httpx.Client()
37+
response_after_expiry = httpx_client.get(items_public_url, timeout=5)
3738
assert response_after_expiry.status_code == 403
3839

3940
dataset.delete()
@@ -47,7 +48,8 @@ def test_dataset_should_create_public_items_non_expiring_url(self, apify_client:
4748

4849
assert 'signature=' in items_public_url
4950

50-
response = requests.get(items_public_url, timeout=5)
51+
httpx_client = httpx.Client()
52+
response = httpx_client.get(items_public_url, timeout=5)
5153
assert response.status_code == 200
5254

5355
dataset.delete()

0 commit comments

Comments
 (0)