Skip to content

Commit 00f0ded

Browse files
committed
✅ Fix CLI test
1 parent 9928da9 commit 00f0ded

File tree

1 file changed

+25
-17
lines changed

1 file changed

+25
-17
lines changed

tests/func/test_cli.py

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -285,15 +285,19 @@ def test_minimum_valid_parameters(
285285
mysql_credentials.host,
286286
"-P",
287287
mysql_credentials.port,
288-
"--mysql-integer-type",
289-
mysql_integer_type,
290-
"--mysql-string-type",
291-
mysql_string_type,
292-
"--mysql-text-type",
293-
mysql_text_type,
294-
"-c",
295-
chunk,
296288
]
289+
if mysql_integer_type:
290+
arguments.append("--mysql-integer-type")
291+
arguments.append(mysql_integer_type)
292+
if mysql_string_type:
293+
arguments.append("--mysql-string-type")
294+
arguments.append(mysql_string_type)
295+
if mysql_text_type:
296+
arguments.append("--mysql-text-type")
297+
arguments.append(mysql_text_type)
298+
if chunk:
299+
arguments.append("-c")
300+
arguments.append(chunk)
297301
if with_rowid:
298302
arguments.append("--with-rowid")
299303
result = cli_runner.invoke(
@@ -457,12 +461,12 @@ def test_version(self, cli_runner):
457461
def test_quiet(
458462
self,
459463
cli_runner,
464+
mysql_database,
460465
sqlite_database,
461466
mysql_credentials,
462467
mysql_integer_type,
463468
mysql_string_type,
464469
mysql_text_type,
465-
mysql_database,
466470
chunk,
467471
with_rowid,
468472
):
@@ -479,16 +483,20 @@ def test_quiet(
479483
mysql_credentials.host,
480484
"-P",
481485
mysql_credentials.port,
482-
"--mysql-integer-type",
483-
mysql_integer_type,
484-
"--mysql-string-type",
485-
mysql_string_type,
486-
"--mysql-text-type",
487-
mysql_text_type,
488-
"-c",
489-
chunk,
490486
"-q",
491487
]
488+
if mysql_integer_type:
489+
arguments.append("--mysql-integer-type")
490+
arguments.append(mysql_integer_type)
491+
if mysql_string_type:
492+
arguments.append("--mysql-string-type")
493+
arguments.append(mysql_string_type)
494+
if mysql_text_type:
495+
arguments.append("--mysql-text-type")
496+
arguments.append(mysql_text_type)
497+
if chunk:
498+
arguments.append("-c")
499+
arguments.append(chunk)
492500
if with_rowid:
493501
arguments.append("--with-rowid")
494502
result = cli_runner.invoke(

0 commit comments

Comments
 (0)