import os
from ee_s1_ard import S1ARDImageCollection
import ee

gee_key = os.environ["GEE_KEY"]


def test_s1ard_image_collection():
    credentials = ee.ServiceAccountCredentials(gee_key, gee_key)
    ee.Initialize(credentials)

    collection = S1ARDImageCollection(
        start_date="2020-01-01",
        stop_date="2020-12-31",
        geometry={
            "type": "Polygon",
            "coordinates": [[[-122.5, 37.7], [-122.5, 37.8], [-122.4, 37.8], [-122.4, 37.7], [-122.5, 37.7]]],
        },
    ).get_collection()

    assert collection.size().getInfo() > 0, "The image collection should not be empty"
