File tree Expand file tree Collapse file tree 3 files changed +24
-7
lines changed
Expand file tree Collapse file tree 3 files changed +24
-7
lines changed Original file line number Diff line number Diff line change 11"""Utility to transfer data from SQLite 3 to MySQL."""
2- __version__ = "2.1.6 "
2+ __version__ = "2.1.7 "
33
44from .transporter import SQLite3toMySQL
Original file line number Diff line number Diff line change 22import os
33import sys
44import typing as t
5+ from datetime import datetime
56
67import click
78from mysql .connector import CharacterSet
89from tabulate import tabulate
910
1011from . import SQLite3toMySQL
12+ from . import __version__ as package_version
1113from .click_utils import OptionEatAll , prompt_password
1214from .debug_info import info
1315from .mysql_utils import MYSQL_INSERT_METHOD , MYSQL_TEXT_COLUMN_TYPES , mysql_supported_character_sets
1416
1517
16- @click .command ()
18+ _copyright_header : str = f"sqlite3mysql version { package_version } Copyright (c) 2018-{ datetime .now ().year } Klemen Tusar"
19+
20+
21+ @click .command (
22+ name = "sqlite3mysql" ,
23+ help = _copyright_header ,
24+ no_args_is_help = True ,
25+ epilog = "For more information, visit https://github.com/techouse/sqlite3-to-mysql" ,
26+ )
1727@click .option (
1828 "-f" ,
1929 "--sqlite-file" ,
@@ -140,6 +150,7 @@ def cli(
140150 debug : bool ,
141151) -> None :
142152 """Transfer SQLite to MySQL using the provided CLI options."""
153+ click .echo (_copyright_header )
143154 try :
144155 if mysql_collation :
145156 charset_collations : t .Tuple [str , ...] = tuple (
Original file line number Diff line number Diff line change 11import typing as t
2+ from datetime import datetime
23from random import choice , sample
34
45import pytest
1011from sqlalchemy .engine import Engine , Inspector
1112
1213from sqlite3_to_mysql import SQLite3toMySQL
14+ from sqlite3_to_mysql import __version__ as package_version
1315from sqlite3_to_mysql .cli import cli as sqlite3mysql
1416from tests .conftest import MySQLCredentials
1517
1921class TestSQLite3toMySQL :
2022 def test_no_arguments (self , cli_runner : CliRunner , mysql_database : Engine ) -> None :
2123 result : Result = cli_runner .invoke (sqlite3mysql )
22- assert result .exit_code > 0
23- assert any (
24+ assert result .exit_code == 0
25+ assert all (
2426 message in result .output
2527 for message in {
26- 'Error: Missing option "-f" / "--sqlite-file"' ,
27- "Error: Missing option '-f' / '--sqlite-file' " ,
28+ f"Usage: { sqlite3mysql . name } [OPTIONS]" ,
29+ f" { sqlite3mysql . name } version { package_version } Copyright (c) 2018- { datetime . now (). year } Klemen Tusar " ,
2830 }
2931 )
3032
@@ -538,5 +540,9 @@ def test_quiet(
538540 sqlite3mysql ,
539541 arguments ,
540542 )
543+ print (result .output )
541544 assert result .exit_code == 0
542- assert result .output == ""
545+ assert (
546+ f"{ sqlite3mysql .name } version { package_version } Copyright (c) 2018-{ datetime .now ().year } Klemen Tusar"
547+ in result .output
548+ )
You can’t perform that action at this time.
0 commit comments