mirror of
https://github.com/echemdata/galvani.git
synced 2025-12-14 09:15:34 +00:00
Optionally read Arbin into in-memory sqlite without temporary file
This commit is contained in:
@@ -53,6 +53,21 @@ def test_convert_Arbin_to_sqlite_function(testdata_dir, tmpdir, basename):
|
||||
csr.fetchone()
|
||||
|
||||
|
||||
@pytest.mark.parametrize("basename", ["arbin1", "UM34_Test005E"])
|
||||
def test_convert_Arbin_to_sqlite_function_in_memory(testdata_dir, tmpdir, basename):
|
||||
"""Convert an Arbin file to an in-memory SQLite database."""
|
||||
res_file = os.path.join(testdata_dir, basename + ".res")
|
||||
conn = None
|
||||
try:
|
||||
conn = res2sqlite.convert_arbin_to_sqlite(res_file)
|
||||
assert conn is not None
|
||||
csr = conn.execute("SELECT * FROM Channel_Normal_Table;")
|
||||
csr.fetchone()
|
||||
finally:
|
||||
if conn is not None:
|
||||
conn.close()
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
not have_mdbtools, reason="Reading the Arbin file requires MDBTools"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user