"""Integration tests that require network access."""
from __future__ import annotations
import pytest
from src.scraper import fetch_amsterdam_cinemas
@pytest.mark.asyncio
async def test_fetch_amsterdam_cinemas() -> None:
"""Test fetching and parsing Amsterdam cinemas (requires network)."""
# This test requires internet access and will fail if the website is down
# Skip if running in CI without network access
try:
cinemas = await fetch_amsterdam_cinemas()
assert len(cinemas) > 0, "Should find at least one cinema"
# Check that cinemas have names
for cinema in cinemas:
assert cinema.name, "Cinema should have a name"
assert len(cinema.name) > 0, "Cinema name should not be empty"
# Check that at least some cinemas have movies
cinemas_with_movies = [c for c in cinemas if c.movies]
assert len(cinemas_with_movies) > 0, "Should find at least one cinema with movies"
except Exception as e:
pytest.skip(f"Skipping integration test due to network error: {e}")