Skip to content

Commit ad7181f

Browse files
committed
Tests: Now testing CLI for all major dbs
1 parent d5c05b8 commit ad7181f

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

tests/test_cli.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
import sys
44
from datetime import datetime, timedelta
55

6-
from data_diff.databases import MySQL
7-
from data_diff.sqeleton.queries import commit
6+
from data_diff.sqeleton.queries import commit, current_timestamp
87

9-
from .common import TEST_MYSQL_CONN_STRING, DiffTestCase
8+
from .common import DiffTestCase, CONN_STRINGS
9+
from .test_diff_tables import test_each_database
1010

1111

1212
def run_datadiff_cli(*args):
@@ -20,14 +20,14 @@ def run_datadiff_cli(*args):
2020
return stdout.splitlines()
2121

2222

23+
@test_each_database
2324
class TestCLI(DiffTestCase):
24-
db_cls = MySQL
2525
src_schema = {"id": int, "datetime": datetime, "text_comment": str}
2626

2727
def setUp(self) -> None:
2828
super().setUp()
2929

30-
now = self.connection.query("select now()", datetime)
30+
now = self.connection.query(current_timestamp(), datetime)
3131

3232
rows = [
3333
(now, "now"),
@@ -46,16 +46,18 @@ def setUp(self) -> None:
4646
)
4747

4848
def test_basic(self):
49+
conn_str = CONN_STRINGS[self.db_cls]
4950
diff = run_datadiff_cli(
50-
TEST_MYSQL_CONN_STRING, self.table_src_name, TEST_MYSQL_CONN_STRING, self.table_dst_name
51+
conn_str, self.table_src_name, conn_str, self.table_dst_name
5152
)
5253
assert len(diff) == 1
5354

5455
def test_options(self):
56+
conn_str = CONN_STRINGS[self.db_cls]
5557
diff = run_datadiff_cli(
56-
TEST_MYSQL_CONN_STRING,
58+
conn_str,
5759
self.table_src_name,
58-
TEST_MYSQL_CONN_STRING,
60+
conn_str,
5961
self.table_dst_name,
6062
"--bisection-factor",
6163
"16",

0 commit comments

Comments
 (0)