@@ -181,11 +181,11 @@ def app(database_url, monkeypatch):
181181
182182@pytest .fixture
183183def app_excludes (database_url , monkeypatch ):
184- """Create APP with but excludes `public.nongeo_data` table ."""
184+ """Create APP with but excludes `public.nongeo_data` and `public.minnesota` tables ."""
185185 postgres_settings = PostgresSettings (database_url = database_url )
186186 db_settings = DatabaseSettings (
187187 schemas = ["public" ],
188- exclude_tables = ["public.nongeo_data" ],
188+ exclude_tables = ["public.nongeo_data" , "public.minnesota" ],
189189 functions = [],
190190 only_spatial_tables = False ,
191191 )
@@ -203,11 +203,11 @@ def app_excludes(database_url, monkeypatch):
203203
204204@pytest .fixture
205205def app_includes (database_url , monkeypatch ):
206- """Create APP with only `public.nongeo_data` table."""
206+ """Create APP with only `public.nongeo_data` and `public.minnesota` table."""
207207 postgres_settings = PostgresSettings (database_url = database_url )
208208 db_settings = DatabaseSettings (
209209 schemas = ["public" ],
210- tables = ["public.nongeo_data" ],
210+ tables = ["public.nongeo_data" , "public.minnesota" ],
211211 functions = [],
212212 only_spatial_tables = False ,
213213 )
@@ -223,6 +223,69 @@ def app_includes(database_url, monkeypatch):
223223 yield client
224224
225225
226+ @pytest .fixture
227+ def app_excludes_function (database_url , monkeypatch ):
228+ """Create APP with but excludes `pg_temp.squares` and `public.st_squaregrid` functions."""
229+ postgres_settings = PostgresSettings (database_url = database_url )
230+ db_settings = DatabaseSettings (
231+ schemas = ["public" ],
232+ tables = [],
233+ exclude_functions = ["pg_temp.squares" , "public.st_squaregrid" ],
234+ )
235+ sql_settings = CustomSQLSettings (custom_sql_directory = SQL_FUNCTIONS_DIRECTORY )
236+
237+ app = create_tipg_app (
238+ postgres_settings = postgres_settings ,
239+ db_settings = db_settings ,
240+ sql_settings = sql_settings ,
241+ )
242+
243+ with TestClient (app ) as client :
244+ yield client
245+
246+
247+ @pytest .fixture
248+ def app_includes_function (database_url , monkeypatch ):
249+ """Create APP with only `public.nongeo_data` table."""
250+ postgres_settings = PostgresSettings (database_url = database_url )
251+ db_settings = DatabaseSettings (
252+ schemas = [],
253+ tables = [],
254+ functions = ["pg_temp.hexagons" ],
255+ )
256+ sql_settings = CustomSQLSettings (custom_sql_directory = SQL_FUNCTIONS_DIRECTORY )
257+
258+ app = create_tipg_app (
259+ postgres_settings = postgres_settings ,
260+ db_settings = db_settings ,
261+ sql_settings = sql_settings ,
262+ )
263+
264+ with TestClient (app ) as client :
265+ yield client
266+
267+
268+ @pytest .fixture
269+ def app_empty (database_url , monkeypatch ):
270+ """Create APP with only no table nor function."""
271+ postgres_settings = PostgresSettings (database_url = database_url )
272+ db_settings = DatabaseSettings (
273+ schemas = [],
274+ tables = [],
275+ functions = [],
276+ )
277+ sql_settings = CustomSQLSettings (custom_sql_directory = SQL_FUNCTIONS_DIRECTORY )
278+
279+ app = create_tipg_app (
280+ postgres_settings = postgres_settings ,
281+ db_settings = db_settings ,
282+ sql_settings = sql_settings ,
283+ )
284+
285+ with TestClient (app ) as client :
286+ yield client
287+
288+
226289@pytest .fixture
227290def app_myschema (database_url ):
228291 """Create APP with only tables from `myschema` schema and no function schema.
0 commit comments