Skip to content

Commit bc0db93

Browse files
committed
verify has cli steps also for sqlite
1 parent f01b576 commit bc0db93

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

tests/test_parametric.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,25 @@ def sqlite_verify(sql: str, rels: bool) -> str:
3838
cursor.execute(sql)
3939
conn.commit()
4040

41-
return gen_code_from_sqlite(str(sqlite_path), rels)
41+
func_code = gen_code_from_sqlite(str(sqlite_path), rels)
42+
short_arg_cli_code = _sqlite_cli(sqlite_path, rels, True)
43+
long_arg_cli_code = _sqlite_cli(sqlite_path, rels, False)
44+
45+
assert func_code == short_arg_cli_code
46+
assert func_code == long_arg_cli_code
47+
48+
return func_code
49+
50+
def _sqlite_cli(sqlite_path: Path, rels: bool, short_arg: bool = False) -> str:
51+
args = [
52+
'-s' if short_arg else '--sqlite',
53+
str(sqlite_path),
54+
]
55+
56+
if rels:
57+
args.append('-r')
58+
59+
return launch_cli_in_tmpfile(args=args)
4260

4361
def postgres_verify(sql: str, rels: bool, schema_name: str = 'public') -> str:
4462
with postgres_container() as pgc:

0 commit comments

Comments
 (0)