def test_create_sub_shape_portion(self): dto = Portion() dto.text = constant.PORTION_TEXT dto.font_bold = "True" dto.font_height = 20 dto.latin_font = constant.FONT_NAME fill_format = SolidFill() fill_format.color = constant.COLOR dto.fill_format = fill_format BaseTest.slides_api.copy_file( "TempTests/" + constant.FILE_NAME, constant.FOLDER_NAME + "/" + constant.FILE_NAME) slide_index = 6 shape_index = 1 paragraph_index = 1 shape_path = "3/shapes" response = BaseTest.slides_api.create_subshape_portion( constant.FILE_NAME, slide_index, shape_path, shape_index, paragraph_index, dto, None, constant.PASSWORD, constant.FOLDER_NAME) self.assertEqual(dto.text, response.text) self.assertEqual(dto.font_bold, response.font_bold) self.assertEqual(dto.font_height, response.font_height) self.assertEqual(dto.latin_font, response.latin_font) self.assertEqual("Solid", response.fill_format.type)
def test_smart_art_text_formatting(self): BaseTest.slides_api.copy_file( "TempTests/" + constant.FILE_NAME, constant.FOLDER_NAME + "/" + constant.FILE_NAME) portion = Portion() portion.text = "New text" portion.font_height = 24 portion.font_bold = "True" portion.spacing = 3 fill_format = SolidFill() fill_format.color = "#FFFFFF00" portion.fill_format = fill_format target_node_path = "1/nodes/1/nodes" slide_index = 7 response = BaseTest.slides_api.update_subshape_portion( constant.FILE_NAME, slide_index, target_node_path, 2, 1, 1, portion, constant.PASSWORD, constant.FOLDER_NAME) self.assertIsNotNone(response) self.assertEqual(response.text, portion.text) self.assertEqual(response.font_height, portion.font_height) self.assertEqual(response.font_bold, portion.font_bold) self.assertEqual(response.spacing, portion.spacing) self.assertEqual(response.fill_format.color, portion.fill_format.color)