From cba4252f2e0738ba5fa316743311c00b5cb5586d Mon Sep 17 00:00:00 2001 From: Kian-Tat Lim Date: Mon, 4 Nov 2024 16:28:18 -0800 Subject: [PATCH] Add test for visit schema. --- tests/test_pqserver.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_pqserver.py b/tests/test_pqserver.py index dcec1cef..f263344d 100644 --- a/tests/test_pqserver.py +++ b/tests/test_pqserver.py @@ -103,6 +103,13 @@ def lsstcomcamsim(request, astropy_tables, scope="module"): # Insert rows into the SQL table connection.execute(sql_table.insert(), rows) + with instance.engine.begin() as connection: + connection.exec_driver_sql( + "DROP VIEW IF EXISTS cdb_lsstcomcamsim.visit1;" + "CREATE VIEW cdb_lsstcomcamsim.visit1 AS" + " SELECT * FROM cdb_lsstcomcamsim.exposure;" + ) + pqserver.engine = instance.engine pqserver.instrument_tables = pqserver.InstrumentTables() @@ -266,6 +273,7 @@ def test_schema_instrument(lsstcomcamsim): "exposure_flexdata_schema", "ccdexposure_flexdata", "ccdexposure_flexdata_schema", + "visit1", ] tables = [f"cdb_lsstcomcamsim.{t}" for t in tables] for t in tables: