@@ -21,11 +21,21 @@ def get_resource(self, base_absolut_url):
21
21
({"projectId" : 1 , "bundleId" : 1 }, "projects/1/bundles/1" ),
22
22
),
23
23
)
24
- def test_get_reports_path (self , incoming_data , path , base_absolut_url ):
25
-
24
+ def test_get_bundles_path (self , incoming_data , path , base_absolut_url ):
26
25
resource = self .get_resource (base_absolut_url )
27
26
assert resource .get_bundles_path (** incoming_data ) == path
28
27
28
+ @pytest .mark .parametrize (
29
+ "incoming_data, path" ,
30
+ (
31
+ ({"projectId" : 1 , "bundleId" : 2 }, "projects/1/bundles/2/exports" ),
32
+ ({"projectId" : 1 , "bundleId" : 2 , "exportId" : "3" }, "projects/1/bundles/2/exports/3" ),
33
+ ),
34
+ )
35
+ def test_get_bundles_exports_path (self , incoming_data , path , base_absolut_url ):
36
+ resource = self .get_resource (base_absolut_url )
37
+ assert resource .get_bundles_exports_path (** incoming_data ) == path
38
+
29
39
@mock .patch ("crowdin_api.requester.APIRequester.request" )
30
40
def test_get_bundle (self , m_request , base_absolut_url ):
31
41
m_request .return_value = "response"
@@ -159,6 +169,36 @@ def test_edit_bundle(self, m_request, base_absolut_url, value):
159
169
path = resource .get_bundles_path (projectId = 1 , bundleId = 1 ),
160
170
)
161
171
172
+ @mock .patch ("crowdin_api.requester.APIRequester.request" )
173
+ def test_download_bundle (self , m_request , base_absolut_url ):
174
+ m_request .return_value = "response"
175
+
176
+ resource = self .get_resource (base_absolut_url )
177
+ assert resource .download_bundle (projectId = 1 , bundleId = 1 , exportId = "1" ) == "response"
178
+ m_request .assert_called_once_with (
179
+ method = "get" , path = f"{ resource .get_bundles_exports_path (projectId = 1 , bundleId = 1 , exportId = '1' )} /download"
180
+ )
181
+
182
+ @mock .patch ("crowdin_api.requester.APIRequester.request" )
183
+ def test_export_bundle (self , m_request , base_absolut_url ):
184
+ m_request .return_value = "response"
185
+
186
+ resource = self .get_resource (base_absolut_url )
187
+ assert resource .export_bundle (projectId = 1 , bundleId = 1 ) == "response"
188
+ m_request .assert_called_once_with (
189
+ method = "post" , path = resource .get_bundles_exports_path (projectId = 1 , bundleId = 1 )
190
+ )
191
+
192
+ @mock .patch ("crowdin_api.requester.APIRequester.request" )
193
+ def test_check_bundle_export_status (self , m_request , base_absolut_url ):
194
+ m_request .return_value = "response"
195
+
196
+ resource = self .get_resource (base_absolut_url )
197
+ assert resource .check_bundle_export_status (projectId = 1 , bundleId = 1 , exportId = "1" ) == "response"
198
+ m_request .assert_called_once_with (
199
+ method = "get" , path = resource .get_bundles_exports_path (projectId = 1 , bundleId = 1 , exportId = "1" )
200
+ )
201
+
162
202
@pytest .mark .parametrize (
163
203
"incoming_data, request_params" ,
164
204
(
0 commit comments