DMSC Integration Testing

Last updated: September 15, 2025 23:36:07

Test: ingestor|dream|dataset_found_is_not_old|

None

None

None

None

None

None

None

None

None

None

None

None

None

None

instrument = 'dream', coda_proposal_id = '977695'

def test_dataset_found_is_not_old(
instrument: str,
coda_proposal_id: str,
) -> None:
ds = scicat.get_latest_coda_dataset(
instrument=instrument, proposal_id=coda_proposal_id
)
creation_time = cast(datetime, ds.creation_time)
> assert creation_time > datetime.now(creation_time.tzinfo) - timedelta(hours=24)
E assert datetime.datetime(2025, 8, 30, 8, 57, 18, 513000, tzinfo=tzutc()) > (datetime.datetime(2025, 8, 31, 22, 24, 1, 503650, tzinfo=tzutc()) - datetime.timedelta(days=1))
E + where datetime.datetime(2025, 8, 31, 22, 24, 1, 503650, tzinfo=tzutc()) = (tzutc())
E + where = datetime.now
E + and tzutc() = datetime.datetime(2025, 8, 30, 8, 57, 18, 513000, tzinfo=tzutc()).tzinfo
E + and datetime.timedelta(days=1) = timedelta(hours=24)

tests/ingestor/ingestor_test.py:57: AssertionError

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

None

instrument = 'dream', coda_proposal_id = '977695'

def test_dataset_found_is_not_old(
instrument: str,
coda_proposal_id: str,
) -> None:
ds = scicat.get_latest_coda_dataset(
instrument=instrument, proposal_id=coda_proposal_id
)
creation_time = cast(datetime, ds.creation_time)
> assert creation_time > datetime.now(creation_time.tzinfo) - timedelta(hours=24)
E assert datetime.datetime(2025, 7, 22, 9, 53, 16, 560000, tzinfo=tzutc()) > (datetime.datetime(2025, 7, 28, 22, 16, 41, 721756, tzinfo=tzutc()) - datetime.timedelta(days=1))
E + where datetime.datetime(2025, 7, 28, 22, 16, 41, 721756, tzinfo=tzutc()) = (tzutc())
E + where = datetime.now
E + and tzutc() = datetime.datetime(2025, 7, 22, 9, 53, 16, 560000, tzinfo=tzutc()).tzinfo
E + and datetime.timedelta(days=1) = timedelta(hours=24)

tests/ingestor/ingestor_test.py:57: AssertionError

instrument = 'dream', coda_proposal_id = '977695'

def test_dataset_found_is_not_old(
instrument: str,
coda_proposal_id: str,
) -> None:
ds = scicat.get_latest_coda_dataset(
instrument=instrument, proposal_id=coda_proposal_id
)
creation_time = cast(datetime, ds.creation_time)
> assert creation_time > datetime.now(creation_time.tzinfo) - timedelta(hours=24)
E assert datetime.datetime(2025, 7, 22, 9, 53, 16, 560000, tzinfo=tzutc()) > (datetime.datetime(2025, 7, 27, 22, 16, 37, 540782, tzinfo=tzutc()) - datetime.timedelta(days=1))
E + where datetime.datetime(2025, 7, 27, 22, 16, 37, 540782, tzinfo=tzutc()) = (tzutc())
E + where = datetime.now
E + and tzutc() = datetime.datetime(2025, 7, 22, 9, 53, 16, 560000, tzinfo=tzutc()).tzinfo
E + and datetime.timedelta(days=1) = timedelta(hours=24)

tests/ingestor/ingestor_test.py:57: AssertionError