Skip to content

Commit 2e655a7

Browse files
test: update tests for new default zone names and dataset IDs
- Update test_client.py to expect new default zone names (web_unlocker1, serp_api1, browser_api1) - Fix test_amazon.py dataset IDs to match actual values in scraper - Update test_scrapers.py to verify COST_PER_RECORD uses DEFAULT_COST_PER_RECORD constant These changes align tests with the refactoring that replaced magic numbers with constants and updated default zone names to match Bright Data conventions.
1 parent a1720ba commit 2e655a7

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

tests/unit/test_amazon.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ def test_dataset_ids_are_correct(self):
107107
scraper = AmazonScraper(bearer_token="test_token_123456789")
108108

109109
# Verify known IDs
110-
assert scraper.DATASET_ID == "gd_l7q7dkf244hwxbl93" # Products
111-
assert scraper.DATASET_ID_REVIEWS == "gd_l1vq6tkpl34p7mq7c" # Reviews
112-
assert scraper.DATASET_ID_SELLERS == "gd_lwjkkolem8c4o7j3s" # Sellers
110+
assert scraper.DATASET_ID == "gd_l7q7dkf244hwjntr0" # Products
111+
assert scraper.DATASET_ID_REVIEWS == "gd_le8e811kzy4ggddlq" # Reviews
112+
assert scraper.DATASET_ID_SELLERS == "gd_lhotzucw1etoe5iw1k" # Sellers
113113

114114

115115
class TestAmazonSyncVsAsyncMode:

tests/unit/test_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ def test_client_with_explicit_token(self):
1616

1717
assert client.token == "test_token_123456789"
1818
assert client.timeout == 30 # Default timeout
19-
assert client.web_unlocker_zone == "sdk_unlocker"
20-
assert client.serp_zone == "sdk_serp"
21-
assert client.browser_zone == "sdk_browser"
19+
assert client.web_unlocker_zone == "web_unlocker1"
20+
assert client.serp_zone == "serp_api1"
21+
assert client.browser_zone == "browser_api1"
2222

2323
def test_client_with_custom_config(self):
2424
"""Test client with custom configuration."""

tests/unit/test_scrapers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,9 @@ def test_amazon_scraper_has_correct_attributes(self):
170170
scraper = AmazonScraper(bearer_token="test_token_123456789")
171171

172172
assert scraper.PLATFORM_NAME == "amazon"
173-
assert scraper.DATASET_ID == "gd_l7q7dkf244hwxbl93"
173+
assert scraper.DATASET_ID == "gd_l7q7dkf244hwjntr0"
174174
assert scraper.MIN_POLL_TIMEOUT == 240
175+
assert scraper.COST_PER_RECORD == 0.001 # Uses DEFAULT_COST_PER_RECORD
175176

176177
def test_amazon_scraper_has_products_method(self):
177178
"""Test AmazonScraper has products search method."""

0 commit comments

Comments
 (0)