Skip to content

Commit 4dc2345

Browse files
committed
[DOP-29475] Fix tests
1 parent 99ceb04 commit 4dc2345

File tree

4 files changed

+40
-40
lines changed

4 files changed

+40
-40
lines changed

tests/test_unit/test_transfers/test_create_transfer.py

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ async def test_guest_cannot_create_transfer(
151151
"name": "new test transfer",
152152
"source_connection_id": first_connection.id,
153153
"target_connection_id": second_connection.id,
154-
"source_params": {"type": "postgres", "table_name": "source_table"},
155-
"target_params": {"type": "postgres", "table_name": "target_table"},
154+
"source_params": {"type": "postgres", "table_name": "schema.source_table"},
155+
"target_params": {"type": "postgres", "table_name": "schema.target_table"},
156156
"queue_id": group_queue.id,
157157
},
158158
)
@@ -182,8 +182,8 @@ async def test_groupless_user_cannot_create_transfer(
182182
"name": "new test transfer",
183183
"source_connection_id": first_conn.id,
184184
"target_connection_id": second_conn.id,
185-
"source_params": {"type": "postgres", "table_name": "source_table"},
186-
"target_params": {"type": "postgres", "table_name": "target_table"},
185+
"source_params": {"type": "postgres", "table_name": "schema.source_table"},
186+
"target_params": {"type": "postgres", "table_name": "schema.target_table"},
187187
"queue_id": group_queue.id,
188188
},
189189
)
@@ -216,8 +216,8 @@ async def test_other_group_user_plus_cannot_create_group_transfer(
216216
"name": "new test group transfer",
217217
"source_connection_id": first_conn.id,
218218
"target_connection_id": second_conn.id,
219-
"source_params": {"type": "postgres", "table_name": "source_table"},
220-
"target_params": {"type": "postgres", "table_name": "target_table"},
219+
"source_params": {"type": "postgres", "table_name": "schema.source_table"},
220+
"target_params": {"type": "postgres", "table_name": "schema.target_table"},
221221
"queue_id": group_queue.id,
222222
},
223223
)
@@ -249,8 +249,8 @@ async def test_superuser_can_create_transfer(
249249
"name": "new test group transfer",
250250
"source_connection_id": first_conn.id,
251251
"target_connection_id": second_conn.id,
252-
"source_params": {"type": "postgres", "table_name": "source_table"},
253-
"target_params": {"type": "postgres", "table_name": "target_table"},
252+
"source_params": {"type": "postgres", "table_name": "schema.source_table"},
253+
"target_params": {"type": "postgres", "table_name": "schema.target_table"},
254254
"transformations": [
255255
{
256256
"type": "dataframe_rows_filter",
@@ -487,7 +487,7 @@ async def test_superuser_can_create_transfer(
487487
{
488488
"source_params": {
489489
"type": "new some connection type",
490-
"table_name": "source_table",
490+
"table_name": "schema.source_table",
491491
},
492492
},
493493
{
@@ -513,7 +513,7 @@ async def test_superuser_can_create_transfer(
513513
"tag": "new some connection type",
514514
},
515515
"input": {
516-
"table_name": "source_table",
516+
"table_name": "schema.source_table",
517517
"type": "new some connection type",
518518
},
519519
},
@@ -835,8 +835,8 @@ async def test_check_fields_validation_on_create_transfer(
835835
"group_id": mock_group.id,
836836
"source_connection_id": first_conn.id,
837837
"target_connection_id": second_conn.id,
838-
"source_params": {"type": "postgres", "table_name": "source_table"},
839-
"target_params": {"type": "postgres", "table_name": "target_table"},
838+
"source_params": {"type": "postgres", "table_name": "schema.source_table"},
839+
"target_params": {"type": "postgres", "table_name": "schema.target_table"},
840840
"queue_id": group_queue.id,
841841
}
842842
transfer_data.update(new_data)
@@ -868,8 +868,8 @@ async def test_check_connection_types_and_its_params_on_create_transfer(
868868
"group_id": mock_group.id,
869869
"source_connection_id": first_conn.connection.id,
870870
"target_connection_id": second_conn.id,
871-
"source_params": {"type": "postgres", "table_name": "source_table"},
872-
"target_params": {"type": "oracle", "table_name": "target_table"},
871+
"source_params": {"type": "postgres", "table_name": "schema.source_table"},
872+
"target_params": {"type": "oracle", "table_name": "schema.target_table"},
873873
"queue_id": group_queue.id,
874874
},
875875
)
@@ -903,8 +903,8 @@ async def test_check_different_connections_owner_group_on_create_transfer(
903903
"group_id": mock_group.id,
904904
"source_connection_id": first_conn.connection.id,
905905
"target_connection_id": group_connection.connection.id,
906-
"source_params": {"type": "postgres", "table_name": "source_table"},
907-
"target_params": {"type": "postgres", "table_name": "target_table"},
906+
"source_params": {"type": "postgres", "table_name": "schema.source_table"},
907+
"target_params": {"type": "postgres", "table_name": "schema.target_table"},
908908
"queue_id": group_queue.id,
909909
},
910910
)
@@ -931,8 +931,8 @@ async def test_unauthorized_user_cannot_create_transfer(
931931
"name": "New transfer name",
932932
"source_connection_id": group_transfer.source_connection_id,
933933
"target_connection_id": group_transfer.target_connection_id,
934-
"source_params": {"type": "postgres", "table_name": "test"},
935-
"target_params": {"type": "postgres", "table_name": "test1"},
934+
"source_params": {"type": "postgres", "table_name": "schema.test"},
935+
"target_params": {"type": "postgres", "table_name": "schema.test1"},
936936
"queue_id": group_queue.id,
937937
},
938938
)
@@ -964,8 +964,8 @@ async def test_developer_plus_cannot_create_transfer_with_other_group_queue(
964964
"name": "new test transfer",
965965
"source_connection_id": first_conn.id,
966966
"target_connection_id": second_conn.id,
967-
"source_params": {"type": "postgres", "table_name": "source_table"},
968-
"target_params": {"type": "postgres", "table_name": "target_table"},
967+
"source_params": {"type": "postgres", "table_name": "schema.source_table"},
968+
"target_params": {"type": "postgres", "table_name": "schema.target_table"},
969969
"queue_id": group_transfer.transfer.queue_id,
970970
},
971971
)
@@ -998,7 +998,7 @@ async def test_developer_plus_cannot_create_transfer_with_target_format_json(
998998
"name": "new test transfer",
999999
"source_connection_id": first_connection.id,
10001000
"target_connection_id": second_connection.id,
1001-
"source_params": {"type": "postgres", "table_name": "source_table"},
1001+
"source_params": {"type": "postgres", "table_name": "schema.source_table"},
10021002
"target_params": {
10031003
"type": "s3",
10041004
"directory_path": "/some/dir",
@@ -1055,8 +1055,8 @@ async def test_superuser_cannot_create_transfer_with_other_group_queue(
10551055
"name": "new test transfer",
10561056
"source_connection_id": first_conn.id,
10571057
"target_connection_id": second_conn.id,
1058-
"source_params": {"type": "postgres", "table_name": "source_table"},
1059-
"target_params": {"type": "postgres", "table_name": "target_table"},
1058+
"source_params": {"type": "postgres", "table_name": "schema.source_table"},
1059+
"target_params": {"type": "postgres", "table_name": "schema.target_table"},
10601060
"queue_id": group_transfer.transfer.queue_id,
10611061
},
10621062
)
@@ -1090,8 +1090,8 @@ async def test_group_member_cannot_create_transfer_with_unknown_connection_error
10901090
"name": "new test transfer",
10911091
"source_connection_id": first_conn.id if iter_conn_id[0] else -1,
10921092
"target_connection_id": second_conn.id if iter_conn_id[1] else -1,
1093-
"source_params": {"type": "postgres", "table_name": "source_table"},
1094-
"target_params": {"type": "postgres", "table_name": "target_table"},
1093+
"source_params": {"type": "postgres", "table_name": "schema.source_table"},
1094+
"target_params": {"type": "postgres", "table_name": "schema.target_table"},
10951095
"queue_id": group_queue.id,
10961096
},
10971097
)
@@ -1123,8 +1123,8 @@ async def test_developer_plus_cannot_create_transfer_with_unknown_group_error(
11231123
"name": "new test transfer",
11241124
"source_connection_id": first_conn.id,
11251125
"target_connection_id": second_conn.id,
1126-
"source_params": {"type": "postgres", "table_name": "source_table"},
1127-
"target_params": {"type": "postgres", "table_name": "target_table"},
1126+
"source_params": {"type": "postgres", "table_name": "schema.source_table"},
1127+
"target_params": {"type": "postgres", "table_name": "schema.target_table"},
11281128
"queue_id": group_queue.id,
11291129
},
11301130
)
@@ -1157,8 +1157,8 @@ async def test_superuser_cannot_create_transfer_with_unknown_connection_error(
11571157
"name": "new test transfer",
11581158
"source_connection_id": first_conn.id if conn_id[0] else -1,
11591159
"target_connection_id": second_conn.id if conn_id[1] else -1,
1160-
"source_params": {"type": "postgres", "table_name": "source_table"},
1161-
"target_params": {"type": "postgres", "table_name": "target_table"},
1160+
"source_params": {"type": "postgres", "table_name": "schema.source_table"},
1161+
"target_params": {"type": "postgres", "table_name": "schema.target_table"},
11621162
"queue_id": group_queue.id,
11631163
},
11641164
)
@@ -1189,8 +1189,8 @@ async def test_developer_plus_cannot_create_transfer_with_unknown_queue_error(
11891189
"name": "new test transfer",
11901190
"source_connection_id": first_conn.id,
11911191
"target_connection_id": second_conn.id,
1192-
"source_params": {"type": "postgres", "table_name": "source_table"},
1193-
"target_params": {"type": "postgres", "table_name": "target_table"},
1192+
"source_params": {"type": "postgres", "table_name": "schema.source_table"},
1193+
"target_params": {"type": "postgres", "table_name": "schema.target_table"},
11941194
"queue_id": -1,
11951195
},
11961196
)
@@ -1221,8 +1221,8 @@ async def test_superuser_cannot_create_transfer_with_unknown_group_error(
12211221
"name": "new test transfer",
12221222
"source_connection_id": first_conn.id,
12231223
"target_connection_id": second_conn.id,
1224-
"source_params": {"type": "postgres", "table_name": "source_table"},
1225-
"target_params": {"type": "postgres", "table_name": "target_table"},
1224+
"source_params": {"type": "postgres", "table_name": "schema.source_table"},
1225+
"target_params": {"type": "postgres", "table_name": "schema.target_table"},
12261226
"queue_id": group_queue.id,
12271227
},
12281228
)
@@ -1252,8 +1252,8 @@ async def test_superuser_cannot_create_transfer_with_unknown_queue_error(
12521252
"name": "new test transfer",
12531253
"source_connection_id": first_conn.id,
12541254
"target_connection_id": second_conn.id,
1255-
"source_params": {"type": "postgres", "table_name": "source_table"},
1256-
"target_params": {"type": "postgres", "table_name": "target_table"},
1255+
"source_params": {"type": "postgres", "table_name": "schema.source_table"},
1256+
"target_params": {"type": "postgres", "table_name": "schema.target_table"},
12571257
"queue_id": -1,
12581258
},
12591259
)

tests/test_unit/test_transfers/test_update_transfer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ async def test_check_connection_types_and_its_params_transfer(
168168
"name": "New transfer name",
169169
"source_params": {
170170
"type": "oracle",
171-
"table_name": "New table name",
171+
"table_name": "schema.table",
172172
},
173173
}
174174

tests/test_unit/test_transfers/transfer_fixtures/transfers_fixture.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ async def group_transfers(
8787
ConnectionType.MSSQL,
8888
ConnectionType.MYSQL,
8989
]:
90-
source_params["table_name"] = "source_table"
91-
target_params["table_name"] = "target_table"
90+
source_params["table_name"] = "schema.source_table"
91+
target_params["table_name"] = "schema.target_table"
9292

9393
transfer = await create_transfer(
9494
session=session,

tests/test_unit/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ async def create_transfer(
190190
description=description,
191191
group_id=group_id,
192192
source_connection_id=source_connection_id,
193-
source_params=source_params or {"type": "postgres", "table_name": "table1"},
193+
source_params=source_params or {"type": "postgres", "table_name": "schema.table1"},
194194
target_connection_id=target_connection_id,
195-
target_params=target_params or {"type": "postgres", "table_name": "table1"},
195+
target_params=target_params or {"type": "postgres", "table_name": "schema.table2"},
196196
transformations=transformations or [],
197197
resources=resources or {"max_parallel_tasks": 1, "cpu_cores_per_task": 1, "ram_bytes_per_task": 1024**3},
198198
is_scheduled=is_scheduled,

0 commit comments

Comments
 (0)