Skip to content

Commit

Permalink
Apply review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicoretti committed Jul 9, 2024
1 parent 6a8b50f commit 26e9211
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 25 deletions.
35 changes: 16 additions & 19 deletions test/integration/etl_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,29 +49,26 @@ def import_table(connection, table):

@pytest.mark.etl
@pytest.mark.parametrize(
"params,expected",
"params",
[
({}, []),
({"format": "gz"}, []),
({"encoding": "WINDOWS-1251"}, []),
({"columns": ["register_dt", "user_id", "status", "user_name"]}, []),
(
{
"csv_cols": [
"1",
"2",
"3 FORMAT='DD-MM-YYYY'",
"4..6",
"7 FORMAT='999.99999'",
"8",
]
},
[],
),
{},
{"format": "gz"},
{"encoding": "WINDOWS-1251"},
{"columns": ["register_dt", "user_id", "status", "user_name"]},
{
"csv_cols": [
"1",
"2",
"3 FORMAT='DD-MM-YYYY'",
"4..6",
"7 FORMAT='999.99999'",
"8",
]
},
],
)
def test_export_import_round_trip_to_and_from_file(
connection, export_file, table, import_table, params, expected
connection, export_file, table, import_table, params
):
connection.export_to_file(export_file, table, export_params=params)
connection.import_from_file(export_file, import_table, import_params=params)
Expand Down
5 changes: 0 additions & 5 deletions test/integration/export_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ def data(faker):
yield [(faker.first_name(), faker.last_name()) for _ in range(0, 10)]


@pytest.fixture
def swaped_data(data):
yield [(lastname, firstname) for firstname, lastname in data]


@pytest.fixture
def table(connection, empty_table, data):
name = empty_table
Expand Down
2 changes: 1 addition & 1 deletion test/integration/import_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def csv_file(tmp_path, data):


@pytest.mark.etl
def test_import_with_custom_csv_format(connection, empty_table, csv_file, data):
def test_import_csv(connection, empty_table, csv_file, data):
connection.import_from_file(csv_file, empty_table)
result = connection.execute(f"SELECT * FROM {empty_table};")

Expand Down

0 comments on commit 26e9211

Please sign in to comment.