fb / app /tests /test_services.py
rastof9's picture
Saving local changes before rebase
d488241
raw
history blame contribute delete
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()