From fc0624692f11409ca55df0b5761318a1b54abedc Mon Sep 17 00:00:00 2001 From: Andrej Date: Thu, 5 Jun 2025 18:38:31 +0500 Subject: [PATCH] test_sql - use Ifc2Sql patcher for readability --- src/ifcopenshell-python/test/test_sql.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/ifcopenshell-python/test/test_sql.py b/src/ifcopenshell-python/test/test_sql.py index 22fba621e1..6d6c85786c 100644 --- a/src/ifcopenshell-python/test/test_sql.py +++ b/src/ifcopenshell-python/test/test_sql.py @@ -20,6 +20,7 @@ import tempfile import ifcpatch import ifcopenshell from pathlib import Path +from ifcpatch.recipes import Ifc2Sql TEST_FILE = Path(__file__).parent / "files" / "basic.ifc" SQLITE_PATH = None @@ -29,13 +30,10 @@ def get_ifc_sqlite() -> ifcopenshell.sqlite: global SQLITE_PATH if SQLITE_PATH is None: tmp = tempfile.NamedTemporaryFile(delete=False, suffix=".ifcsqlite") - ifcpatch.execute( - { - "file": ifcopenshell.open(TEST_FILE), - "recipe": "Ifc2Sql", - "arguments": ["sqlite", None, None, None, tmp.name], - } - ) + ifc_file = ifcopenshell.open(TEST_FILE) + assert isinstance(ifc_file, ifcopenshell.file) + patcher = Ifc2Sql.Patcher(ifc_file, database=tmp.name) + patcher.patch() SQLITE_PATH = tmp.name ifc_sqlite = ifcopenshell.open(SQLITE_PATH) assert isinstance(ifc_sqlite, ifcopenshell.sqlite)