def test_layout_slide_animation(self):
        folder_name = "TempSlidesSDK"
        file_name = "test.pptx"
        password = "******"
        slide_index = 1
        BaseTest.slides_api.copy_file("TempTests/" + file_name,
                                      folder_name + "/" + file_name)

        animation = BaseTest.slides_api.get_special_slide_animation(
            file_name, slide_index, 'layoutSlide', None, None, password,
            folder_name)
        self.assertEqual(1, len(animation.main_sequence))

        effect1 = Effect()
        effect1.type = "Blink"
        effect1.shape_index = 2

        effect2 = Effect()
        effect2.type = "Appear"
        effect2.shape_index = 3

        dto = SlideAnimation()
        dto.main_sequence = [effect1, effect2]
        animation = BaseTest.slides_api.set_special_slide_animation(
            file_name, slide_index, 'layoutSlide', dto, password, folder_name)
        self.assertEqual(len(dto.main_sequence), len(animation.main_sequence))

        animation = BaseTest.slides_api.get_special_slide_animation(
            file_name, slide_index, 'layoutSlide', 3, None, password,
            folder_name)
        self.assertEqual(1, len(animation.main_sequence))

        BaseTest.slides_api.delete_special_slide_animation_effect(
            file_name, slide_index, 'layoutSlide', 2, password, folder_name)
        self.assertEqual(
            len(dto.main_sequence) - 1, len(animation.main_sequence))

        animation = BaseTest.slides_api.get_special_slide_animation(
            file_name, slide_index, 'layoutSlide', 3, None, password,
            folder_name)
        self.assertEqual(0, len(animation.main_sequence))

        BaseTest.slides_api.delete_special_slide_animation(
            file_name, slide_index, 'layoutSlide', password, folder_name)
        self.assertEqual(0, len(animation.main_sequence))
    def test_animation_create_interactive_sequence_effect(self):
        folder_name = "TempSlidesSDK"
        file_name = "test.pptx"
        BaseTest.slides_api.copy_file("TempTests/" + file_name,
                                      folder_name + "/" + file_name)

        dto = Effect()
        dto.type = "Blast"
        dto.shape_index = 3
        animation = BaseTest.slides_api.create_animation_interactive_sequence_effect(
            file_name, 1, 1, dto, "password", folder_name)
        self.assertEqual(1, len(animation.main_sequence))
        self.assertEqual(1, len(animation.interactive_sequences))
    def test_animation_set(self):
        folder_name = "TempSlidesSDK"
        file_name = "test.pptx"
        BaseTest.slides_api.copy_file("TempTests/" + file_name,
                                      folder_name + "/" + file_name)

        dto = SlideAnimation()

        effect1 = Effect()
        effect1.type = "Blink"
        effect1.shape_index = 2
        effect1.paragraph_index = 1

        effect2 = Effect()
        effect2.type = "Box"
        effect2.subtype = "In"
        effect2.preset_class_type = "Entrance"
        effect2.shape_index = 4
        dto.main_sequence = [effect1, effect2]
        dto.interactive_sequences = []
        animation = BaseTest.slides_api.set_animation(file_name, 1, dto,
                                                      "password", folder_name)
        self.assertEqual(len(dto.main_sequence), len(animation.main_sequence))
        self.assertEqual(0, len(animation.interactive_sequences))