@@ -145,54 +145,44 @@ async def test_developer_plus_can_update_s3_transfer(
145145):
146146 # Arrange
147147 user = group_transfer .owner_group .get_member_of_role (role_developer_plus )
148- transformations = [
149- {
150- "type" : "dataframe_rows_filter" ,
151- "filters" : [
152- {
153- "type" : "is_not_null" ,
154- "field" : "col2" ,
155- },
156- ],
148+ updated_fields = {
149+ "source_params" : {
150+ "type" : "ftp" ,
151+ "directory_path" : "/some/new/test/directory" ,
152+ "file_format" : create_transfer_data ["source_and_target_params" ]["file_format" ],
153+ "options" : {"some" : "option" },
157154 },
158- ]
155+ "target_params" : {
156+ "type" : "ftp" ,
157+ "directory_path" : "/some/new/test/directory" ,
158+ "file_format" : create_transfer_data ["source_and_target_params" ]["file_format" ],
159+ "file_name_template" : "{index}.{extension}" ,
160+ "options" : {"some" : "option" },
161+ },
162+ "strategy_params" : {
163+ "type" : "incremental" ,
164+ "increment_by" : "modified_since" ,
165+ },
166+ "transformations" : [
167+ {
168+ "type" : "dataframe_rows_filter" ,
169+ "filters" : [
170+ {
171+ "type" : "is_not_null" ,
172+ "field" : "col2" ,
173+ },
174+ ],
175+ },
176+ ],
177+ }
159178
160179 # Act
161180 result = await client .patch (
162181 f"v1/transfers/{ group_transfer .id } " ,
163182 headers = {"Authorization" : f"Bearer { user .token } " },
164- json = {
165- "source_params" : {
166- "type" : "ftp" ,
167- "directory_path" : "/some/new/test/directory" ,
168- "file_format" : create_transfer_data ["source_and_target_params" ]["file_format" ],
169- "options" : {"some" : "option" },
170- },
171- "target_params" : {
172- "type" : "ftp" ,
173- "directory_path" : "/some/new/test/directory" ,
174- "file_format" : create_transfer_data ["source_and_target_params" ]["file_format" ],
175- "file_name_template" : "{index}.{extension}" ,
176- "options" : {"some" : "option" },
177- },
178- "transformations" : transformations ,
179- },
183+ json = updated_fields ,
180184 )
181185
182- # Pre-Assert
183- source_params = group_transfer .source_params .copy ()
184- source_params .update (
185- {
186- "directory_path" : "/some/new/test/directory" ,
187- "file_format" : create_transfer_data ["source_and_target_params" ]["file_format" ],
188- "options" : {"some" : "option" },
189- },
190- )
191- target_params = {
192- ** source_params ,
193- "file_name_template" : "{index}.{extension}" ,
194- }
195-
196186 # Assert
197187 assert result .status_code == 200
198188 assert result .json () == {
@@ -204,9 +194,9 @@ async def test_developer_plus_can_update_s3_transfer(
204194 "is_scheduled" : group_transfer .is_scheduled ,
205195 "source_connection_id" : group_transfer .source_connection_id ,
206196 "target_connection_id" : group_transfer .target_connection_id ,
207- "source_params" : source_params ,
208- "target_params" : target_params ,
209- "strategy_params" : group_transfer . strategy_params ,
210- "transformations" : transformations ,
197+ "source_params" : updated_fields [ " source_params" ] ,
198+ "target_params" : updated_fields [ " target_params" ] ,
199+ "strategy_params" : updated_fields [ " strategy_params" ] ,
200+ "transformations" : updated_fields [ " transformations" ] ,
211201 "queue_id" : group_transfer .transfer .queue_id ,
212202 }
0 commit comments