File tree 3 files changed +24
-7
lines changed 3 files changed +24
-7
lines changed Original file line number Diff line number Diff line change 1
1
"""Utility to transfer data from SQLite 3 to MySQL."""
2
- __version__ = "2.1.6 "
2
+ __version__ = "2.1.7 "
3
3
4
4
from .transporter import SQLite3toMySQL
Original file line number Diff line number Diff line change 2
2
import os
3
3
import sys
4
4
import typing as t
5
+ from datetime import datetime
5
6
6
7
import click
7
8
from mysql .connector import CharacterSet
8
9
from tabulate import tabulate
9
10
10
11
from . import SQLite3toMySQL
12
+ from . import __version__ as package_version
11
13
from .click_utils import OptionEatAll , prompt_password
12
14
from .debug_info import info
13
15
from .mysql_utils import MYSQL_INSERT_METHOD , MYSQL_TEXT_COLUMN_TYPES , mysql_supported_character_sets
14
16
15
17
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
+ )
17
27
@click .option (
18
28
"-f" ,
19
29
"--sqlite-file" ,
@@ -140,6 +150,7 @@ def cli(
140
150
debug : bool ,
141
151
) -> None :
142
152
"""Transfer SQLite to MySQL using the provided CLI options."""
153
+ click .echo (_copyright_header )
143
154
try :
144
155
if mysql_collation :
145
156
charset_collations : t .Tuple [str , ...] = tuple (
Original file line number Diff line number Diff line change 1
1
import typing as t
2
+ from datetime import datetime
2
3
from random import choice , sample
3
4
4
5
import pytest
10
11
from sqlalchemy .engine import Engine , Inspector
11
12
12
13
from sqlite3_to_mysql import SQLite3toMySQL
14
+ from sqlite3_to_mysql import __version__ as package_version
13
15
from sqlite3_to_mysql .cli import cli as sqlite3mysql
14
16
from tests .conftest import MySQLCredentials
15
17
19
21
class TestSQLite3toMySQL :
20
22
def test_no_arguments (self , cli_runner : CliRunner , mysql_database : Engine ) -> None :
21
23
result : Result = cli_runner .invoke (sqlite3mysql )
22
- assert result .exit_code > 0
23
- assert any (
24
+ assert result .exit_code == 0
25
+ assert all (
24
26
message in result .output
25
27
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 " ,
28
30
}
29
31
)
30
32
@@ -538,5 +540,9 @@ def test_quiet(
538
540
sqlite3mysql ,
539
541
arguments ,
540
542
)
543
+ print (result .output )
541
544
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