Download app/tests/test_services.py from rastof9/fb: direct link, hf CLI and curl.
- Browser
- Download file 636 Bytes
-
https://huggingface.co/spaces/rastof9/fb/resolve/main/app/tests/test_services.py
- Command line
-
hf download hf://spaces/rastof9/fb/app/tests/test_services.py
-
curl -L -o test_services.py https://huggingface.co/spaces/rastof9/fb/resolve/main/app/tests/test_services.py
636 Bytes
| import pytest | |
| from app.services.ai_processor import AIPipeline | |
| from app.services.scraper import FacebookScraper | |
| def test_ai_processor(): | |
| ai = AIPipeline() | |
| result = ai.process_ad("This is a positive ad!") | |
| assert "sentiment" in result | |
| def test_scraper(): | |
| scraper = FacebookScraper() | |
| ads = scraper.scrape_ads("test query", num_scrolls=1) | |
| assert isinstance(ads, list) | |
| def test_blockchain(): | |
| from app.services.blockchain import AdBlockchain | |
| blockchain = AdBlockchain() | |
| block = blockchain.create_block(proof=123, previous_hash="abc") | |
| assert block["index"] == 2 | |
| assert blockchain.is_chain_valid() |