aspose_slides_cloud 20.4.0 → 20.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +61 -61
- data/TestData/ChartTest.pptx +0 -0
- data/TestData/Sections.pptx +0 -0
- data/TestData/TemplatingCVDataWithBase64.xml +22 -22
- data/lib/aspose_slides_cloud.rb +212 -205
- data/lib/aspose_slides_cloud/api/slides_api.rb +10979 -7974
- data/lib/aspose_slides_cloud/api/slides_api_requests.rb +4146 -3099
- data/lib/aspose_slides_cloud/api_client.rb +432 -429
- data/lib/aspose_slides_cloud/models/add_layout_slide.rb +244 -261
- data/lib/aspose_slides_cloud/models/add_master_slide.rb +259 -276
- data/lib/aspose_slides_cloud/models/add_shape.rb +239 -256
- data/lib/aspose_slides_cloud/models/add_slide.rb +269 -286
- data/lib/aspose_slides_cloud/models/api_info.rb +217 -205
- data/lib/aspose_slides_cloud/models/arrow_head_properties.rb +285 -273
- data/lib/aspose_slides_cloud/models/audio_frame.rb +359 -573
- data/lib/aspose_slides_cloud/models/axes.rb +237 -225
- data/lib/aspose_slides_cloud/models/axis.rb +699 -687
- data/lib/aspose_slides_cloud/models/base64_input_file.rb +230 -256
- data/lib/aspose_slides_cloud/models/blur_effect.rb +227 -215
- data/lib/aspose_slides_cloud/models/box_and_whisker_series.rb +299 -0
- data/lib/aspose_slides_cloud/models/bubble_chart_data_point.rb +212 -230
- data/lib/aspose_slides_cloud/models/bubble_series.rb +248 -428
- data/lib/aspose_slides_cloud/models/chart.rb +365 -553
- data/lib/aspose_slides_cloud/models/chart_category.rb +271 -0
- data/lib/aspose_slides_cloud/models/chart_title.rb +222 -210
- data/lib/aspose_slides_cloud/models/chart_wall.rb +281 -269
- data/lib/aspose_slides_cloud/models/color_scheme.rb +317 -327
- data/lib/aspose_slides_cloud/models/common_slide_view_properties.rb +217 -0
- data/lib/aspose_slides_cloud/models/connector.rb +275 -487
- data/lib/aspose_slides_cloud/models/custom_dash_pattern.rb +209 -197
- data/lib/aspose_slides_cloud/models/{resource_uri_element.rb → data_point.rb} +197 -195
- data/lib/aspose_slides_cloud/models/disc_usage.rb +227 -215
- data/lib/aspose_slides_cloud/models/document.rb +257 -267
- data/lib/aspose_slides_cloud/models/document_properties.rb +209 -219
- data/lib/aspose_slides_cloud/models/document_property.rb +232 -242
- data/lib/aspose_slides_cloud/models/document_replace_result.rb +218 -282
- data/lib/aspose_slides_cloud/models/effect.rb +424 -412
- data/lib/aspose_slides_cloud/models/effect_format.rb +277 -265
- data/lib/aspose_slides_cloud/models/entity_exists.rb +212 -0
- data/lib/aspose_slides_cloud/models/error.rb +237 -225
- data/lib/aspose_slides_cloud/models/error_details.rb +222 -210
- data/lib/aspose_slides_cloud/models/export_format.rb +60 -59
- data/lib/aspose_slides_cloud/models/export_options.rb +216 -194
- data/lib/aspose_slides_cloud/models/file_version.rb +225 -270
- data/lib/aspose_slides_cloud/models/file_versions.rb +209 -197
- data/lib/aspose_slides_cloud/models/files_list.rb +209 -197
- data/lib/aspose_slides_cloud/models/files_upload_result.rb +221 -209
- data/lib/aspose_slides_cloud/models/fill_format.rb +240 -228
- data/lib/aspose_slides_cloud/models/fill_overlay_effect.rb +246 -234
- data/lib/aspose_slides_cloud/models/font_scheme.rb +227 -237
- data/lib/aspose_slides_cloud/models/font_set.rb +227 -215
- data/lib/aspose_slides_cloud/models/format_scheme.rb +245 -255
- data/lib/aspose_slides_cloud/models/geometry_shape.rb +260 -439
- data/lib/aspose_slides_cloud/models/glow_effect.rb +222 -210
- data/lib/aspose_slides_cloud/models/gradient_fill.rb +342 -359
- data/lib/aspose_slides_cloud/models/gradient_fill_stop.rb +222 -210
- data/lib/aspose_slides_cloud/models/graphical_object.rb +234 -422
- data/lib/aspose_slides_cloud/models/group_shape.rb +234 -422
- data/lib/aspose_slides_cloud/models/header_footer.rb +247 -0
- data/lib/aspose_slides_cloud/models/html_export_options.rb +421 -420
- data/lib/aspose_slides_cloud/models/i_shape_export_options.rb +197 -195
- data/lib/aspose_slides_cloud/models/image.rb +237 -247
- data/lib/aspose_slides_cloud/models/image_export_format.rb +43 -43
- data/lib/aspose_slides_cloud/models/image_export_options.rb +299 -298
- data/lib/aspose_slides_cloud/models/images.rb +209 -219
- data/lib/aspose_slides_cloud/models/inner_shadow_effect.rb +252 -240
- data/lib/aspose_slides_cloud/models/input.rb +227 -215
- data/lib/aspose_slides_cloud/models/input_file.rb +250 -238
- data/lib/aspose_slides_cloud/models/interactive_sequence.rb +224 -212
- data/lib/aspose_slides_cloud/models/layout_slide.rb +278 -288
- data/lib/aspose_slides_cloud/models/layout_slides.rb +209 -219
- data/lib/aspose_slides_cloud/models/legend.rb +321 -309
- data/lib/aspose_slides_cloud/models/line_format.rb +389 -377
- data/lib/aspose_slides_cloud/models/master_slide.rb +231 -241
- data/lib/aspose_slides_cloud/models/master_slides.rb +209 -219
- data/lib/aspose_slides_cloud/models/merge.rb +231 -248
- data/lib/aspose_slides_cloud/models/merging_source.rb +219 -207
- data/lib/aspose_slides_cloud/models/no_fill.rb +219 -236
- data/lib/aspose_slides_cloud/models/normal_view_restored_properties.rb +217 -0
- data/lib/aspose_slides_cloud/models/notes_slide.rb +217 -227
- data/lib/aspose_slides_cloud/models/notes_slide_export_format.rb +43 -43
- data/lib/aspose_slides_cloud/models/notes_slide_header_footer.rb +267 -0
- data/lib/aspose_slides_cloud/models/object_exist.rb +227 -215
- data/lib/aspose_slides_cloud/models/ole_object_frame.rb +259 -447
- data/lib/aspose_slides_cloud/models/one_value_chart_data_point.rb +210 -200
- data/lib/aspose_slides_cloud/models/one_value_series.rb +248 -428
- data/lib/aspose_slides_cloud/models/ordered_merge_request.rb +209 -197
- data/lib/aspose_slides_cloud/models/outer_shadow_effect.rb +252 -240
- data/lib/aspose_slides_cloud/models/output_file.rb +240 -228
- data/lib/aspose_slides_cloud/models/paragraph.rb +517 -527
- data/lib/aspose_slides_cloud/models/paragraphs.rb +209 -219
- data/lib/aspose_slides_cloud/models/path_input_file.rb +240 -266
- data/lib/aspose_slides_cloud/models/path_output_file.rb +239 -256
- data/lib/aspose_slides_cloud/models/pattern_fill.rb +266 -283
- data/lib/aspose_slides_cloud/models/pdf_export_options.rb +547 -519
- data/lib/aspose_slides_cloud/models/picture_fill.rb +351 -368
- data/lib/aspose_slides_cloud/models/picture_frame.rb +245 -459
- data/lib/aspose_slides_cloud/models/pipeline.rb +219 -207
- data/lib/aspose_slides_cloud/models/placeholder.rb +325 -335
- data/lib/aspose_slides_cloud/models/placeholders.rb +209 -219
- data/lib/aspose_slides_cloud/models/plot_area.rb +311 -299
- data/lib/aspose_slides_cloud/models/portion.rb +589 -599
- data/lib/aspose_slides_cloud/models/portions.rb +209 -219
- data/lib/aspose_slides_cloud/models/pptx_export_options.rb +247 -246
- data/lib/aspose_slides_cloud/models/presentation_to_merge.rb +229 -217
- data/lib/aspose_slides_cloud/models/presentations_merge_request.rb +221 -209
- data/lib/aspose_slides_cloud/models/preset_shadow_effect.rb +286 -274
- data/lib/aspose_slides_cloud/models/reflection_effect.rb +441 -429
- data/lib/aspose_slides_cloud/models/remove_shape.rb +229 -246
- data/lib/aspose_slides_cloud/models/remove_slide.rb +234 -251
- data/lib/aspose_slides_cloud/models/reorder_slide.rb +249 -266
- data/lib/aspose_slides_cloud/models/replace_text.rb +269 -286
- data/lib/aspose_slides_cloud/models/request_input_file.rb +235 -261
- data/lib/aspose_slides_cloud/models/reset_slide.rb +234 -251
- data/lib/aspose_slides_cloud/models/resource_base.rb +219 -207
- data/lib/aspose_slides_cloud/models/resource_uri.rb +237 -225
- data/lib/aspose_slides_cloud/models/response_output_file.rb +219 -236
- data/lib/aspose_slides_cloud/models/save.rb +266 -283
- data/lib/aspose_slides_cloud/models/save_shape.rb +276 -293
- data/lib/aspose_slides_cloud/models/save_slide.rb +301 -318
- data/lib/aspose_slides_cloud/models/scale_type.rb +41 -41
- data/lib/aspose_slides_cloud/models/scatter_chart_data_point.rb +225 -215
- data/lib/aspose_slides_cloud/models/scatter_series.rb +248 -428
- data/lib/aspose_slides_cloud/models/section.rb +234 -0
- data/lib/aspose_slides_cloud/models/sections.rb +209 -0
- data/lib/aspose_slides_cloud/models/series.rb +422 -389
- data/lib/aspose_slides_cloud/models/series_marker.rb +281 -269
- data/lib/aspose_slides_cloud/models/shape.rb +255 -467
- data/lib/aspose_slides_cloud/models/shape_base.rb +375 -406
- data/lib/aspose_slides_cloud/models/shape_export_format.rb +44 -44
- data/lib/aspose_slides_cloud/models/shape_image_export_options.rb +286 -274
- data/lib/aspose_slides_cloud/models/shape_thumbnail_bounds.rb +41 -41
- data/lib/aspose_slides_cloud/models/shapes.rb +209 -219
- data/lib/aspose_slides_cloud/models/size_type.rb +55 -55
- data/lib/aspose_slides_cloud/models/slide.rb +322 -332
- data/lib/aspose_slides_cloud/models/slide_animation.rb +221 -231
- data/lib/aspose_slides_cloud/models/slide_background.rb +266 -276
- data/lib/aspose_slides_cloud/models/slide_comment.rb +239 -227
- data/lib/aspose_slides_cloud/models/slide_comments.rb +209 -219
- data/lib/aspose_slides_cloud/models/slide_export_format.rb +59 -58
- data/lib/aspose_slides_cloud/models/slide_replace_result.rb +223 -347
- data/lib/aspose_slides_cloud/models/slides.rb +209 -219
- data/lib/aspose_slides_cloud/models/smart_art.rb +342 -530
- data/lib/aspose_slides_cloud/models/smart_art_node.rb +293 -281
- data/lib/aspose_slides_cloud/models/smart_art_shape.rb +235 -422
- data/lib/aspose_slides_cloud/models/soft_edge_effect.rb +212 -200
- data/lib/aspose_slides_cloud/models/solid_fill.rb +229 -246
- data/lib/aspose_slides_cloud/models/split_document_result.rb +209 -219
- data/lib/aspose_slides_cloud/models/storage_exist.rb +212 -200
- data/lib/aspose_slides_cloud/models/storage_file.rb +257 -245
- data/lib/aspose_slides_cloud/models/svg_export_options.rb +379 -378
- data/lib/aspose_slides_cloud/models/swf_export_options.rb +529 -528
- data/lib/aspose_slides_cloud/models/table.rb +350 -538
- data/lib/aspose_slides_cloud/models/table_cell.rb +403 -391
- data/lib/aspose_slides_cloud/models/table_column.rb +212 -200
- data/lib/aspose_slides_cloud/models/table_row.rb +239 -227
- data/lib/aspose_slides_cloud/models/task.rb +240 -228
- data/lib/aspose_slides_cloud/models/text_item.rb +217 -205
- data/lib/aspose_slides_cloud/models/text_items.rb +209 -219
- data/lib/aspose_slides_cloud/models/theme.rb +237 -247
- data/lib/aspose_slides_cloud/models/tiff_export_options.rb +423 -422
- data/lib/aspose_slides_cloud/models/update_background.rb +241 -258
- data/lib/aspose_slides_cloud/models/update_shape.rb +239 -256
- data/lib/aspose_slides_cloud/models/video_frame.rb +329 -543
- data/lib/aspose_slides_cloud/models/view_properties.rb +357 -0
- data/lib/aspose_slides_cloud/models/waterfall_chart_data_point.rb +206 -0
- data/lib/aspose_slides_cloud/models/waterfall_series.rb +247 -0
- data/lib/aspose_slides_cloud/models/xps_export_options.rb +243 -242
- data/lib/aspose_slides_cloud/type_registry.rb +320 -0
- data/lib/aspose_slides_cloud/version.rb +25 -25
- data/spec/api/slides_api_spec.rb +35926 -24406
- data/spec/extra/extra_spec.rb +235 -101
- data/spec/spec_utils.rb +183 -176
- data/testConfig.json +7 -7
- data/testRules.json +472 -340
- metadata +18 -3
data/spec/extra/extra_spec.rb
CHANGED
@@ -1,102 +1,236 @@
|
|
1
|
-
=begin
|
2
|
-
Copyright (c) 2019 Aspose Pty Ltd
|
3
|
-
|
4
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
-
of this software and associated documentation files (the "Software"), to deal
|
6
|
-
in the Software without restriction, including without limitation the rights
|
7
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
-
copies of the Software, and to permit persons to whom the Software is
|
9
|
-
furnished to do so, subject to the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be included in all
|
12
|
-
copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
-
SOFTWARE.
|
21
|
-
=end
|
22
|
-
|
23
|
-
require 'spec_helper'
|
24
|
-
|
25
|
-
describe 'SlidesApiExtra' do
|
26
|
-
describe 'specific cases' do
|
27
|
-
it 'multipart request' do
|
28
|
-
requestParam = AsposeSlidesCloud::PostSlidesPipelineRequest.new
|
29
|
-
requestParam.pipeline = AsposeSlidesCloud::Pipeline.new
|
30
|
-
requestParam.pipeline.input = AsposeSlidesCloud::Input.new
|
31
|
-
requestParam.pipeline.input.template_data = AsposeSlidesCloud::RequestInputFile.new
|
32
|
-
requestParam.pipeline.input.template_data.type = "Request"
|
33
|
-
requestParam.pipeline.input.template_data.index = 0
|
34
|
-
requestParam.pipeline.input.template = AsposeSlidesCloud::RequestInputFile.new
|
35
|
-
requestParam.pipeline.input.template.type = "Request"
|
36
|
-
requestParam.pipeline.input.template.index = 1
|
37
|
-
requestParam.pipeline.tasks = []
|
38
|
-
requestParam.pipeline.tasks.push(AsposeSlidesCloud::Save.new)
|
39
|
-
requestParam.pipeline.tasks[0].type = "Save"
|
40
|
-
requestParam.pipeline.tasks[0].format = "pptx"
|
41
|
-
requestParam.pipeline.tasks[0].output = AsposeSlidesCloud::OutputFile.new
|
42
|
-
requestParam.pipeline.tasks[0].output.type = "Response"
|
43
|
-
requestParam.files = []
|
44
|
-
requestParam.files.push(File.binread(File.join(AsposeSlidesCloud::SpecUtils::TEST_DATA_PATH, "TemplatingCVDataWithBase64.xml")))
|
45
|
-
requestParam.files.push(File.binread(File.join(AsposeSlidesCloud::SpecUtils::TEST_DATA_PATH, "TemplateCV.pptx")))
|
46
|
-
o, c, _h = AsposeSlidesCloud::SpecUtils.api.post_slides_pipeline_with_http_info(requestParam)
|
47
|
-
expect(c).to eq(200)
|
48
|
-
expect(o).not_to be(nil)
|
49
|
-
end
|
50
|
-
|
51
|
-
it '
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
configuration
|
74
|
-
configuration.
|
75
|
-
configuration.
|
76
|
-
configuration.
|
77
|
-
configuration.
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
#requestParam =
|
86
|
-
#requestParam.
|
87
|
-
#requestParam.
|
88
|
-
#requestParam
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2019 Aspose Pty Ltd
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
12
|
+
copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
+
SOFTWARE.
|
21
|
+
=end
|
22
|
+
|
23
|
+
require 'spec_helper'
|
24
|
+
|
25
|
+
describe 'SlidesApiExtra' do
|
26
|
+
describe 'specific cases' do
|
27
|
+
it 'multipart request' do
|
28
|
+
requestParam = AsposeSlidesCloud::PostSlidesPipelineRequest.new
|
29
|
+
requestParam.pipeline = AsposeSlidesCloud::Pipeline.new
|
30
|
+
requestParam.pipeline.input = AsposeSlidesCloud::Input.new
|
31
|
+
requestParam.pipeline.input.template_data = AsposeSlidesCloud::RequestInputFile.new
|
32
|
+
requestParam.pipeline.input.template_data.type = "Request"
|
33
|
+
requestParam.pipeline.input.template_data.index = 0
|
34
|
+
requestParam.pipeline.input.template = AsposeSlidesCloud::RequestInputFile.new
|
35
|
+
requestParam.pipeline.input.template.type = "Request"
|
36
|
+
requestParam.pipeline.input.template.index = 1
|
37
|
+
requestParam.pipeline.tasks = []
|
38
|
+
requestParam.pipeline.tasks.push(AsposeSlidesCloud::Save.new)
|
39
|
+
requestParam.pipeline.tasks[0].type = "Save"
|
40
|
+
requestParam.pipeline.tasks[0].format = "pptx"
|
41
|
+
requestParam.pipeline.tasks[0].output = AsposeSlidesCloud::OutputFile.new
|
42
|
+
requestParam.pipeline.tasks[0].output.type = "Response"
|
43
|
+
requestParam.files = []
|
44
|
+
requestParam.files.push(File.binread(File.join(AsposeSlidesCloud::SpecUtils::TEST_DATA_PATH, "TemplatingCVDataWithBase64.xml")))
|
45
|
+
requestParam.files.push(File.binread(File.join(AsposeSlidesCloud::SpecUtils::TEST_DATA_PATH, "TemplateCV.pptx")))
|
46
|
+
o, c, _h = AsposeSlidesCloud::SpecUtils.api.post_slides_pipeline_with_http_info(requestParam)
|
47
|
+
expect(c).to eq(200)
|
48
|
+
expect(o).not_to be(nil)
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'base shape' do
|
52
|
+
AsposeSlidesCloud::SpecUtils.initialize('GetSlideShape', nil, nil)
|
53
|
+
requestParam = AsposeSlidesCloud::GetSlideShapeRequest.new
|
54
|
+
requestParam.name = "test.ppt"
|
55
|
+
requestParam.slide_index = 1
|
56
|
+
requestParam.shape_index = 1
|
57
|
+
requestParam.password = "password"
|
58
|
+
requestParam.folder = "TempSlidesSDK"
|
59
|
+
o = AsposeSlidesCloud::SpecUtils.api.get_slide_shape(requestParam)
|
60
|
+
expect(o.text).to eq("1")
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'chart' do
|
64
|
+
chart = AsposeSlidesCloud::Chart.new
|
65
|
+
expect(chart.type).to eq("Chart")
|
66
|
+
end
|
67
|
+
|
68
|
+
it 'timeout' do
|
69
|
+
#unstable test
|
70
|
+
#AsposeSlidesCloud::SpecUtils.initialize('post_slide_save_as', nil, nil)
|
71
|
+
|
72
|
+
#config = JSON.parse(File.read('testConfig.json'))
|
73
|
+
#configuration = AsposeSlidesCloud::Configuration.new
|
74
|
+
#configuration.base_url = config["BaseUrl"]
|
75
|
+
#configuration.auth_base_url = config["AuthBaseUrl"] ? config["AuthBaseUrl"] : config["BaseUrl"]
|
76
|
+
#configuration.app_sid = config["AppSid"]
|
77
|
+
#configuration.app_key = config["AppKey"]
|
78
|
+
#configuration.debugging = config["Debug"]
|
79
|
+
#configuration.timeout = 1
|
80
|
+
#api = AsposeSlidesCloud::SlidesApi.new(configuration)
|
81
|
+
|
82
|
+
#requestParam = AsposeSlidesCloud::PostSlideSaveAsRequest.new
|
83
|
+
#requestParam.name = "test.ppt"
|
84
|
+
#requestParam.slide_index = 1
|
85
|
+
#requestParam.password = "password"
|
86
|
+
#requestParam.folder = "TempSlidesSDK"
|
87
|
+
#requestParam.format = "svg"
|
88
|
+
#api.post_slide_save_as(requestParam)
|
89
|
+
end
|
90
|
+
|
91
|
+
it 'nullable properties' do
|
92
|
+
folderName = "TempSlidesSDK"
|
93
|
+
fileName = "placeholders.pptx"
|
94
|
+
password = "password"
|
95
|
+
min1 = 44.3
|
96
|
+
min2 = 12
|
97
|
+
max1 = 104.3
|
98
|
+
max2 = 87
|
99
|
+
AsposeSlidesCloud::SpecUtils.initialize("no_method", "no_property", nil)
|
100
|
+
requestParam = AsposeSlidesCloud::CopyFileRequest.new
|
101
|
+
requestParam.src_path = "TempTests/" + fileName
|
102
|
+
requestParam.dest_path = folderName + "/" + fileName
|
103
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file(requestParam)
|
104
|
+
|
105
|
+
postRequest = AsposeSlidesCloud::PostAddNewShapeRequest.new
|
106
|
+
postRequest.name = fileName
|
107
|
+
postRequest.folder = folderName
|
108
|
+
postRequest.password = password
|
109
|
+
postRequest.slide_index = 1
|
110
|
+
postRequest.dto = AsposeSlidesCloud::Chart.new
|
111
|
+
postRequest.dto.chart_type = "Line"
|
112
|
+
postRequest.dto.width = 400.0
|
113
|
+
postRequest.dto.height = 300.0
|
114
|
+
postRequest.dto.title = AsposeSlidesCloud::ChartTitle.new
|
115
|
+
postRequest.dto.title.has_title = true
|
116
|
+
postRequest.dto.title.text = "MyTitle"
|
117
|
+
postRequest.dto.series = []
|
118
|
+
postRequest.dto.series.push(AsposeSlidesCloud::OneValueSeries.new)
|
119
|
+
postRequest.dto.series[0].type = "ClusteredColumn"
|
120
|
+
postRequest.dto.series[0].data_point_type = "OneValue"
|
121
|
+
postRequest.dto.series[0].name = "Series1"
|
122
|
+
postRequest.dto.series[0].data_points = []
|
123
|
+
postRequest.dto.series[0].data_points.push(AsposeSlidesCloud::OneValueChartDataPoint.new)
|
124
|
+
postRequest.dto.series[0].data_points[0].value = 40.0
|
125
|
+
postRequest.dto.series[0].data_points.push(AsposeSlidesCloud::OneValueChartDataPoint.new)
|
126
|
+
postRequest.dto.series[0].data_points[1].value = 50.0
|
127
|
+
postRequest.dto.axes = AsposeSlidesCloud::Axes.new
|
128
|
+
postRequest.dto.axes.horizontal_axis = AsposeSlidesCloud::Axis.new
|
129
|
+
postRequest.dto.axes.horizontal_axis.is_automatic_min_value = false
|
130
|
+
postRequest.dto.axes.horizontal_axis.min_value = min1
|
131
|
+
postRequest.dto.axes.horizontal_axis.is_automatic_max_value = false
|
132
|
+
postRequest.dto.axes.horizontal_axis.max_value = max1
|
133
|
+
AsposeSlidesCloud::SpecUtils.api.post_add_new_shape(postRequest)
|
134
|
+
|
135
|
+
getRequest = AsposeSlidesCloud::GetSlideShapeRequest.new
|
136
|
+
getRequest.name = fileName
|
137
|
+
getRequest.folder = folderName
|
138
|
+
getRequest.password = password
|
139
|
+
getRequest.slide_index = 1
|
140
|
+
getRequest.shape_index = 4
|
141
|
+
result = AsposeSlidesCloud::SpecUtils.api.get_slide_shape(getRequest)
|
142
|
+
expect(result.axes.horizontal_axis.min_value).to eq(min1)
|
143
|
+
expect(result.axes.horizontal_axis.max_value).to eq(max1)
|
144
|
+
|
145
|
+
putRequest = AsposeSlidesCloud::PutSlideShapeInfoRequest.new
|
146
|
+
putRequest.name = fileName
|
147
|
+
putRequest.folder = folderName
|
148
|
+
putRequest.password = password
|
149
|
+
putRequest.slide_index = 1
|
150
|
+
putRequest.shape_index = 4
|
151
|
+
putRequest.dto = AsposeSlidesCloud::Chart.new
|
152
|
+
putRequest.dto.axes = AsposeSlidesCloud::Axes.new
|
153
|
+
putRequest.dto.axes.horizontal_axis = AsposeSlidesCloud::Axis.new
|
154
|
+
putRequest.dto.axes.horizontal_axis.min_value = min2
|
155
|
+
AsposeSlidesCloud::SpecUtils.api.put_slide_shape_info(putRequest)
|
156
|
+
|
157
|
+
result = AsposeSlidesCloud::SpecUtils.api.get_slide_shape(getRequest)
|
158
|
+
expect(result.axes.horizontal_axis.min_value).to eq(min2)
|
159
|
+
expect(result.axes.horizontal_axis.max_value).to eq(max1)
|
160
|
+
|
161
|
+
putRequest.dto.axes.horizontal_axis = AsposeSlidesCloud::Axis.new
|
162
|
+
putRequest.dto.axes.horizontal_axis.max_value = max2
|
163
|
+
AsposeSlidesCloud::SpecUtils.api.put_slide_shape_info(putRequest)
|
164
|
+
|
165
|
+
result = AsposeSlidesCloud::SpecUtils.api.get_slide_shape(getRequest)
|
166
|
+
expect(result.axes.horizontal_axis.min_value).to eq(min2)
|
167
|
+
expect(result.axes.horizontal_axis.max_value).to eq(max2)
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
describe 'authentication' do
|
172
|
+
it 'good auth' do
|
173
|
+
config = JSON.parse(File.read('testConfig.json'))
|
174
|
+
configuration = AsposeSlidesCloud::Configuration.new
|
175
|
+
configuration.base_url = config["BaseUrl"]
|
176
|
+
configuration.auth_base_url = config["AuthBaseUrl"] ? config["AuthBaseUrl"] : config["BaseUrl"]
|
177
|
+
configuration.app_sid = config["AppSid"]
|
178
|
+
configuration.app_key = config["AppKey"]
|
179
|
+
configuration.debugging = config["Debug"]
|
180
|
+
api = AsposeSlidesCloud::SlidesApi.new(configuration)
|
181
|
+
o, c, _h = api.get_slides_api_info_with_http_info
|
182
|
+
expect(c).to eq(200)
|
183
|
+
expect(o).not_to be(nil)
|
184
|
+
end
|
185
|
+
|
186
|
+
it 'bad auth' do
|
187
|
+
config = JSON.parse(File.read('testConfig.json'))
|
188
|
+
configuration = AsposeSlidesCloud::Configuration.new
|
189
|
+
configuration.base_url = config["BaseUrl"]
|
190
|
+
configuration.auth_base_url = config["AuthBaseUrl"] ? config["AuthBaseUrl"] : config["BaseUrl"]
|
191
|
+
configuration.app_sid = "invalid"
|
192
|
+
configuration.app_key = config["AppKey"]
|
193
|
+
configuration.debugging = config["Debug"]
|
194
|
+
api = AsposeSlidesCloud::SlidesApi.new(configuration)
|
195
|
+
begin
|
196
|
+
o, c, _h = api.get_slides_api_info_with_http_info
|
197
|
+
fail "An exception expected"
|
198
|
+
rescue AsposeSlidesCloud::ApiError => e
|
199
|
+
expect(e.code).to eq(401)
|
200
|
+
expect(e.response_body).to include("invalid_client")
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
it 'good token' do
|
205
|
+
config = JSON.parse(File.read('testConfig.json'))
|
206
|
+
configuration = AsposeSlidesCloud::Configuration.new
|
207
|
+
configuration.base_url = config["BaseUrl"]
|
208
|
+
configuration.auth_base_url = config["AuthBaseUrl"] ? config["AuthBaseUrl"] : config["BaseUrl"]
|
209
|
+
configuration.app_sid = config["AppSid"]
|
210
|
+
configuration.app_key = config["AppKey"]
|
211
|
+
configuration.debugging = config["Debug"]
|
212
|
+
api = AsposeSlidesCloud::SlidesApi.new(configuration)
|
213
|
+
api.get_slides_api_info_with_http_info
|
214
|
+
configuration.app_sid = "invalid"
|
215
|
+
api = AsposeSlidesCloud::SlidesApi.new(configuration)
|
216
|
+
o, c, _h = api.get_slides_api_info_with_http_info
|
217
|
+
expect(c).to eq(200)
|
218
|
+
expect(o).not_to be(nil)
|
219
|
+
end
|
220
|
+
|
221
|
+
it 'bad token' do
|
222
|
+
config = JSON.parse(File.read('testConfig.json'))
|
223
|
+
configuration = AsposeSlidesCloud::Configuration.new
|
224
|
+
configuration.base_url = config["BaseUrl"]
|
225
|
+
configuration.auth_base_url = config["AuthBaseUrl"] ? config["AuthBaseUrl"] : config["BaseUrl"]
|
226
|
+
configuration.app_sid = config["AppSid"]
|
227
|
+
configuration.app_key = config["AppKey"]
|
228
|
+
configuration.access_token = "expired.token"
|
229
|
+
configuration.debugging = config["Debug"]
|
230
|
+
api = AsposeSlidesCloud::SlidesApi.new(configuration)
|
231
|
+
o, c, _h = api.get_slides_api_info_with_http_info
|
232
|
+
expect(c).to eq(200)
|
233
|
+
expect(o).not_to be(nil)
|
234
|
+
end
|
235
|
+
end
|
102
236
|
end
|
data/spec/spec_utils.rb
CHANGED
@@ -1,176 +1,183 @@
|
|
1
|
-
=begin
|
2
|
-
Copyright (c) 2019 Aspose Pty Ltd
|
3
|
-
|
4
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
-
of this software and associated documentation files (the "Software"), to deal
|
6
|
-
in the Software without restriction, including without limitation the rights
|
7
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
-
copies of the Software, and to permit persons to whom the Software is
|
9
|
-
furnished to do so, subject to the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be included in all
|
12
|
-
copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
-
SOFTWARE.
|
21
|
-
=end
|
22
|
-
|
23
|
-
module AsposeSlidesCloud
|
24
|
-
class SpecUtils
|
25
|
-
def self.initialize(method, name, value)
|
26
|
-
if !@@is_initialized
|
27
|
-
download_request = AsposeSlidesCloud::DownloadFileRequest.new
|
28
|
-
download_request.path = "TempTests/version.txt"
|
29
|
-
version =
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
rule["
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
end
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
end
|
120
|
-
return
|
121
|
-
end
|
122
|
-
|
123
|
-
def self.
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
end
|
129
|
-
|
130
|
-
def self.
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
end
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2019 Aspose Pty Ltd
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
12
|
+
copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
+
SOFTWARE.
|
21
|
+
=end
|
22
|
+
|
23
|
+
module AsposeSlidesCloud
|
24
|
+
class SpecUtils
|
25
|
+
def self.initialize(method, name, value)
|
26
|
+
if !@@is_initialized
|
27
|
+
download_request = AsposeSlidesCloud::DownloadFileRequest.new
|
28
|
+
download_request.path = "TempTests/version.txt"
|
29
|
+
version = ""
|
30
|
+
begin
|
31
|
+
version = SpecUtils.api.download_file(download_request)
|
32
|
+
rescue AsposeSlidesCloud::ApiError => e
|
33
|
+
if e.code != 404
|
34
|
+
fail "Could not read from storage"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
if version != EXPECTED_TEST_DATA_VERSION
|
38
|
+
Dir.entries(TEST_DATA_PATH).each { |f|
|
39
|
+
if !File.directory? File.join(TEST_DATA_PATH, f)
|
40
|
+
fd = File.binread(File.join(TEST_DATA_PATH, f))
|
41
|
+
upload_request = AsposeSlidesCloud::UploadFileRequest.new
|
42
|
+
upload_request.file = fd
|
43
|
+
upload_request.path = "TempTests/" + f
|
44
|
+
SpecUtils.api.upload_file(upload_request)
|
45
|
+
end
|
46
|
+
}
|
47
|
+
upload_request = AsposeSlidesCloud::UploadFileRequest.new
|
48
|
+
upload_request.file = EXPECTED_TEST_DATA_VERSION
|
49
|
+
upload_request.path = "TempTests/version.txt"
|
50
|
+
SpecUtils.api.upload_file(upload_request)
|
51
|
+
end
|
52
|
+
@@is_initialized = true
|
53
|
+
end
|
54
|
+
files = Hash.new
|
55
|
+
SpecUtils.test_rules["Files"].each do |rule|
|
56
|
+
if SpecUtils.good_rule?(rule, name, method)
|
57
|
+
actual_name = SpecUtils.untemplatize(rule["File"], value)
|
58
|
+
path = "TempSlidesSDK"
|
59
|
+
if rule.key?("Folder")
|
60
|
+
path = SpecUtils.untemplatize(rule["Folder"], value)
|
61
|
+
end
|
62
|
+
path = path + "/" + actual_name
|
63
|
+
files[path] = rule
|
64
|
+
rule["ActualName"] = actual_name
|
65
|
+
end
|
66
|
+
end
|
67
|
+
files.each do |path, rule|
|
68
|
+
if rule["Action"] == "Put"
|
69
|
+
copy_request = AsposeSlidesCloud::CopyFileRequest.new
|
70
|
+
copy_request.src_path = "TempTests/" + rule['ActualName']
|
71
|
+
copy_request.dest_path = path
|
72
|
+
SpecUtils.api.copy_file(copy_request)
|
73
|
+
elsif rule["Action"] == "Delete"
|
74
|
+
delete_request = AsposeSlidesCloud::DeleteFileRequest.new
|
75
|
+
delete_request.path = path
|
76
|
+
SpecUtils.api.delete_file(delete_request)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
def self.get_param_value(name, method, type)
|
82
|
+
if type == 'File'
|
83
|
+
return File.binread(File.join(TEST_DATA_PATH, "test.ppt"))
|
84
|
+
end
|
85
|
+
value = "test" + name
|
86
|
+
SpecUtils.test_rules["Values"].each do |rule|
|
87
|
+
if SpecUtils.good_rule?(rule, name, method) and rule.key?("Value")
|
88
|
+
value = rule["Value"]
|
89
|
+
end
|
90
|
+
end
|
91
|
+
value
|
92
|
+
end
|
93
|
+
|
94
|
+
def self.invalidize_param_value(name, method, value, type)
|
95
|
+
if type == 'File'
|
96
|
+
return nil
|
97
|
+
end
|
98
|
+
invalid_value = nil
|
99
|
+
SpecUtils.test_rules["Values"].each do |rule|
|
100
|
+
if SpecUtils.good_rule?(rule, name, method) and rule.key?("InvalidValue")
|
101
|
+
invalid_value = rule["InvalidValue"]
|
102
|
+
end
|
103
|
+
end
|
104
|
+
SpecUtils.untemplatize(invalid_value, value)
|
105
|
+
end
|
106
|
+
|
107
|
+
def self.get_expected_error(method, name, value)
|
108
|
+
code = 0
|
109
|
+
message = "Unexpeceted message"
|
110
|
+
SpecUtils.test_rules["Results"].each do |rule|
|
111
|
+
if SpecUtils.good_rule?(rule, name, method)
|
112
|
+
if rule.key?("Code")
|
113
|
+
code = rule["Code"]
|
114
|
+
end
|
115
|
+
if rule.key?("Message")
|
116
|
+
message = SpecUtils.untemplatize(rule["Message"], value)
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
return code, message
|
121
|
+
end
|
122
|
+
|
123
|
+
def self.no_exception?(method, name)
|
124
|
+
SpecUtils.test_rules["OKToNotFail"].each do |rule|
|
125
|
+
return true
|
126
|
+
end
|
127
|
+
return false
|
128
|
+
end
|
129
|
+
|
130
|
+
def self.good_rule?(rule, name, method)
|
131
|
+
(not rule.key?("Language") or rule["Language"].casecmp("Ruby") == 0) \
|
132
|
+
and (not rule.key?("Invalid") or ((name != nil) == rule["Invalid"])) \
|
133
|
+
and (not rule.key?("Parameter") or rule["Parameter"].casecmp(name) == 0) \
|
134
|
+
and (not rule.key?("Method") or rule["Method"].casecmp(method) == 0)
|
135
|
+
end
|
136
|
+
|
137
|
+
def self.untemplatize(template, value)
|
138
|
+
if template == nil
|
139
|
+
value
|
140
|
+
else
|
141
|
+
result = template
|
142
|
+
if template.is_a? String and template.match?("%v")
|
143
|
+
result = "" + template
|
144
|
+
if value != nil
|
145
|
+
result["%v"] = value.to_s
|
146
|
+
else
|
147
|
+
result["%v"] = ""
|
148
|
+
end
|
149
|
+
end
|
150
|
+
result
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
def self.test_rules
|
155
|
+
unless @@test_rules
|
156
|
+
@@test_rules = JSON.parse(File.read('testRules.json'))
|
157
|
+
end
|
158
|
+
@@test_rules
|
159
|
+
end
|
160
|
+
|
161
|
+
@@test_rules = nil
|
162
|
+
|
163
|
+
def self.api
|
164
|
+
unless @@api
|
165
|
+
config = JSON.parse(File.read('testConfig.json'))
|
166
|
+
configuration = AsposeSlidesCloud::Configuration.new
|
167
|
+
configuration.base_url = config["BaseUrl"]
|
168
|
+
configuration.auth_base_url = config["AuthBaseUrl"] ? config["AuthBaseUrl"] : config["BaseUrl"]
|
169
|
+
configuration.app_sid = config["AppSid"]
|
170
|
+
configuration.app_key = config["AppKey"]
|
171
|
+
configuration.debugging = config["Debug"]
|
172
|
+
@@api = AsposeSlidesCloud::SlidesApi.new(configuration)
|
173
|
+
end
|
174
|
+
@@api
|
175
|
+
end
|
176
|
+
|
177
|
+
@@api = nil
|
178
|
+
@@is_initialized = false
|
179
|
+
|
180
|
+
TEST_DATA_PATH = "TestData"
|
181
|
+
EXPECTED_TEST_DATA_VERSION = "1"
|
182
|
+
end
|
183
|
+
end
|