mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-18 23:11:12 +02:00
feat(tiktok): scrape input schema
This commit is contained in:
parent
ef66063bfc
commit
5688ab0678
3 changed files with 89 additions and 0 deletions
26
surfsense_backend/tests/unit/platforms/tiktok/test_input.py
Normal file
26
surfsense_backend/tests/unit/platforms/tiktok/test_input.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
"""Input surface for the TikTok scraper (anonymous, Apify-shaped)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.proprietary.platforms.tiktok.schemas import TikTokScrapeInput
|
||||
|
||||
|
||||
def test_input_has_no_auth_fields():
|
||||
forbidden = {"username", "password", "token", "login", "auth", "credentials"}
|
||||
assert forbidden.isdisjoint(TikTokScrapeInput.model_fields)
|
||||
|
||||
|
||||
def test_input_defaults():
|
||||
model = TikTokScrapeInput()
|
||||
assert model.resultsPerPage == 1
|
||||
assert model.profileSorting == "latest"
|
||||
assert model.proxyCountryCode == "None"
|
||||
assert model.hashtags == []
|
||||
assert model.profiles == []
|
||||
assert model.searchQueries == []
|
||||
assert model.postURLs == []
|
||||
|
||||
|
||||
def test_input_allows_extra_inert_fields():
|
||||
model = TikTokScrapeInput(shouldDownloadVideos=True, videoKvStoreIdOrName="x")
|
||||
assert model.model_dump().get("shouldDownloadVideos") is True
|
||||
Loading…
Add table
Add a link
Reference in a new issue