33import pytest
44import responses
55
6- from scrapegraph_py .client import SyncClient
6+ from scrapegraph_py .client import Client
77from tests .utils import generate_mock_api_key
88
99
@@ -30,7 +30,7 @@ def test_smartscraper(mock_api_key):
3030 },
3131 )
3232
33- with SyncClient (api_key = mock_api_key ) as client :
33+ with Client (api_key = mock_api_key ) as client :
3434 response = client .smartscraper (
3535 website_url = "https://example.com" , user_prompt = "Describe this page."
3636 )
@@ -49,7 +49,7 @@ def test_get_smartscraper(mock_api_key, mock_uuid):
4949 },
5050 )
5151
52- with SyncClient (api_key = mock_api_key ) as client :
52+ with Client (api_key = mock_api_key ) as client :
5353 response = client .get_smartscraper (mock_uuid )
5454 assert response ["status" ] == "completed"
5555 assert response ["request_id" ] == mock_uuid
@@ -63,7 +63,7 @@ def test_get_credits(mock_api_key):
6363 json = {"remaining_credits" : 100 , "total_credits_used" : 50 },
6464 )
6565
66- with SyncClient (api_key = mock_api_key ) as client :
66+ with Client (api_key = mock_api_key ) as client :
6767 response = client .get_credits ()
6868 assert response ["remaining_credits" ] == 100
6969 assert response ["total_credits_used" ] == 50
@@ -77,7 +77,7 @@ def test_submit_feedback(mock_api_key):
7777 json = {"status" : "success" },
7878 )
7979
80- with SyncClient (api_key = mock_api_key ) as client :
80+ with Client (api_key = mock_api_key ) as client :
8181 response = client .submit_feedback (
8282 request_id = str (uuid4 ()), rating = 5 , feedback_text = "Great service!"
8383 )
@@ -92,7 +92,7 @@ def test_network_error(mock_api_key):
9292 body = ConnectionError ("Network error" ),
9393 )
9494
95- with SyncClient (api_key = mock_api_key ) as client :
95+ with Client (api_key = mock_api_key ) as client :
9696 with pytest .raises (ConnectionError ):
9797 client .smartscraper (
9898 website_url = "https://example.com" , user_prompt = "Describe this page."
0 commit comments