From 2b1dcc70c8b09668b513c1641ffa5eedd0f11143 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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_pqserver.py b/tests/test_pqserver.py index dcec1cef..13f20491 100644 --- a/tests/test_pqserver.py +++ b/tests/test_pqserver.py @@ -103,6 +103,12 @@ 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( + "CREATE OR REPLACE VIEW cdb_lsstcomcamsim.visit1 AS" + " SELECT * FROM cdb_lsstcomcamsim.exposure;" + ) + pqserver.engine = instance.engine pqserver.instrument_tables = pqserver.InstrumentTables() @@ -266,6 +272,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: