Skip to content

Commit 70ef8fa

Browse files
committed
fix: address review feedback
1 parent 7f8878a commit 70ef8fa

2 files changed

Lines changed: 25 additions & 9 deletions

File tree

crowdin_api/api_resources/source_strings/resource.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ def edit_string(
148148
self,
149149
stringId: int,
150150
data: Iterable[SourceStringsPatchRequest],
151-
updateOption: Optional[StringUpdateOption] = None,
152151
projectId: Optional[int] = None,
152+
updateOption: Optional[StringUpdateOption] = None,
153153
):
154154
"""
155155
Edit String.
@@ -167,7 +167,7 @@ def edit_string(
167167
request_kwargs = {
168168
"method": "patch",
169169
"path": self.get_source_strings_path(projectId=projectId, stringId=stringId),
170-
"request_data": data
170+
"request_data": data,
171171
}
172172

173173
if params:
@@ -178,8 +178,8 @@ def edit_string(
178178
def string_batch_operation(
179179
self,
180180
data: Iterable[StringBatchOperationPatchRequest],
181-
updateOption: Optional[StringUpdateOption] = None,
182181
projectId: Optional[int] = None,
182+
updateOption: Optional[StringUpdateOption] = None,
183183
):
184184
"""
185185
String Batch Operations.

crowdin_api/api_resources/source_strings/tests/test_source_strings_resources.py

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,17 +208,25 @@ def test_edit_string_with_update_option(self, m_request, base_absolut_url):
208208
"value": "test",
209209
"op": PatchOperation.REPLACE,
210210
"path": SourceStringsPatchPath.TEXT,
211-
}
211+
},
212212
]
213213

214214
resource = self.get_resource(base_absolut_url)
215-
assert resource.edit_string(projectId=1, stringId=2, data=data, updateOption=StringUpdateOption.KEEP_TRANSLATIONS) == "response"
215+
assert (
216+
resource.edit_string(
217+
projectId=1,
218+
stringId=2,
219+
data=data,
220+
updateOption=StringUpdateOption.KEEP_TRANSLATIONS,
221+
)
222+
== "response"
223+
)
216224

217225
m_request.assert_called_once_with(
218226
method="patch",
219227
request_data=data,
220228
params={
221-
"updateOption": "keep_translations"
229+
"updateOption": "keep_translations",
222230
},
223231
path=resource.get_source_strings_path(
224232
projectId=1,
@@ -259,16 +267,24 @@ def test_string_batch_operation_with_update_option(self, m_request, base_absolut
259267
"op": StringBatchOperations.REPLACE,
260268
"path": StringBatchOperationsPath.IS_HIDDEN,
261269
"value": True,
262-
}
270+
},
263271
]
264272

265273
resource = self.get_resource(base_absolut_url)
266-
assert resource.string_batch_operation(projectId=1, data=data, updateOption=StringUpdateOption.KEEP_TRANSLATIONS) == "response"
274+
assert (
275+
resource.string_batch_operation(
276+
projectId=1,
277+
data=data,
278+
updateOption=StringUpdateOption.KEEP_TRANSLATIONS,
279+
)
280+
== "response"
281+
)
282+
267283
m_request.assert_called_once_with(
268284
method="patch",
269285
path=resource.get_source_strings_path(1),
270286
request_data=data,
271287
params={
272-
"updateOption": "keep_translations"
288+
"updateOption": "keep_translations",
273289
},
274290
)

0 commit comments

Comments
 (0)