Skip to content

Commit d32fb48

Browse files
committed
Fold the older SDK test into the contract test
Two tests pinned overlapping facts about the same SDK surface. One now holds all of them, and the file is back under the line budget.
1 parent 082dab8 commit d32fb48

1 file changed

Lines changed: 1 addition & 18 deletions

File tree

‎tests/test_scrape.py‎

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -127,24 +127,6 @@ def __exit__(self, *exc):
127127
assert seen.get("auto_create_zones") is False
128128

129129

130-
def test_the_sdk_still_offers_the_call_this_repo_makes():
131-
"""A stub client cannot notice an SDK rename. This can, offline and unauthenticated.
132-
133-
Without it, dropping num_of_posts upstream leaves every test green and every
134-
user broken.
135-
"""
136-
from brightdata import SyncBrightDataClient
137-
from brightdata.scrapers.instagram.search import InstagramSearchScraper
138-
from brightdata.sync_client import SyncInstagramSearchScraper
139-
140-
assert isinstance(SyncBrightDataClient.search, property)
141-
assert callable(SyncInstagramSearchScraper.posts)
142-
143-
params = inspect.signature(InstagramSearchScraper.posts).parameters
144-
assert "url" in params, params
145-
assert "num_of_posts" in params, params
146-
147-
148130
def fake_cli(monkeypatch, outcome_for):
149131
"""Point the CLI at a client that never exists and a handler we control."""
150132
cli = sys.modules["ig_scraper.__main__"]
@@ -207,6 +189,7 @@ def test_the_sdk_contract_the_readme_relies_on():
207189
assert callable(getattr(InstagramScraper, name + suffix, None)), name + suffix
208190
for name in ("profiles", "posts", "reels", "reels_all"):
209191
assert callable(getattr(InstagramSearchScraper, name, None)), name
192+
assert "num_of_posts" in inspect.signature(InstagramSearchScraper.posts).parameters
210193

211194
# Scrapers go through trigger, progress and snapshot. There is no sync path.
212195
client = next(c for c in vars(api_client).values() if hasattr(c, "TRIGGER_URL"))

0 commit comments

Comments
 (0)