@@ -632,3 +632,73 @@ def test_export_project_translation(self, m_request, in_params, request_data, ba
632632 request_data = request_data ,
633633 path = "projects/1/translations/exports" ,
634634 )
635+
636+ @pytest .mark .parametrize (
637+ "in_data, request_data" ,
638+ (
639+ (
640+ {
641+ "storage_id" : 1 ,
642+ "language_ids" : [1 , 2 , 3 ],
643+ "file_id" : 1 ,
644+ "import_eq_suggestions" : True ,
645+ "auto_approve_imported" : True ,
646+ "translate_hidden" : True ,
647+ "add_to_tm" : True
648+ },
649+ {
650+ "storageId" : 1 ,
651+ "languageIds" : [1 , 2 , 3 ],
652+ "fileId" : 1 ,
653+ "importEqSuggestions" : True ,
654+ "autoApproveImported" : True ,
655+ "translateHidden" : True ,
656+ "addToTm" : True
657+ },
658+ ),
659+ )
660+ )
661+ @mock .patch ("crowdin_api.requester.APIRequester.request" )
662+ def test_import_translations (self , m_request , in_data , request_data , base_absolut_url ):
663+ m_request .return_value = "response"
664+
665+ project_id = 1
666+
667+ resource = self .get_resource (base_absolut_url )
668+ assert resource .import_translations (project_id , ** in_data ) == "response"
669+
670+ m_request .assert_called_once_with (
671+ method = "post" ,
672+ path = f"projects/{ project_id } /translations/imports" ,
673+ request_data = request_data ,
674+ )
675+
676+ @mock .patch ("crowdin_api.requester.APIRequester.request" )
677+ def test_import_translations_status (self , m_request , base_absolut_url ):
678+ m_request .return_value = "response"
679+
680+ project_id = 1
681+ import_translation_id = 2
682+
683+ resource = self .get_resource (base_absolut_url )
684+ assert resource .import_translations_status (project_id , import_translation_id ) == "response"
685+
686+ m_request .assert_called_once_with (
687+ method = "get" ,
688+ path = f"projects/{ project_id } /translations/imports/{ import_translation_id } " ,
689+ )
690+
691+ @mock .patch ("crowdin_api.requester.APIRequester.request" )
692+ def test_import_translations_report (self , m_request , base_absolut_url ):
693+ m_request .return_value = "response"
694+
695+ project_id = 1
696+ import_translation_id = 2
697+
698+ resource = self .get_resource (base_absolut_url )
699+ assert resource .import_translations_report (project_id , import_translation_id ) == "response"
700+
701+ m_request .assert_called_once_with (
702+ method = "get" ,
703+ path = f"projects/{ project_id } /translations/imports/{ import_translation_id } /report" ,
704+ )
0 commit comments