Skip to content

Commit 5217326

Browse files
committed
🐛 fix #96
1 parent f413af5 commit 5217326

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/mysql_to_sqlite3/transporter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ def __init__(self, **kwargs: tx.Unpack[MySQLtoSQLiteParams]) -> None:
5555
else:
5656
self._sqlite_file = realpath(str(kwargs.get("sqlite_file")))
5757

58-
self._mysql_password = str(kwargs.get("mysql_password")) or None
58+
password: t.Optional[t.Union[str, bool]] = kwargs.get("mysql_password")
59+
self._mysql_password = password if isinstance(password, str) else None
5960

6061
self._mysql_host = kwargs.get("mysql_host", "localhost") or "localhost"
6162

tests/func/test_cli.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,3 +642,23 @@ def test_without_tables_and_without_data_flags(
642642
"Error: Both -Z/--without-tables and -W/--without-data are set. There is nothing to do. Exiting..."
643643
in result.output
644644
)
645+
646+
def test_passwordless_login(
647+
self, cli_runner: CliRunner, sqlite_database: "os.PathLike[t.Any]", mysql_credentials: MySQLCredentials
648+
) -> None:
649+
result: Result = cli_runner.invoke(
650+
mysql2sqlite,
651+
[
652+
"-f",
653+
str(sqlite_database),
654+
"-d",
655+
mysql_credentials.database,
656+
"-u",
657+
mysql_credentials.user,
658+
"-h",
659+
mysql_credentials.host,
660+
"-P",
661+
str(mysql_credentials.port),
662+
],
663+
)
664+
assert "using password: NO" in result.output

0 commit comments

Comments
 (0)