Skip to content

Commit bc7abe0

Browse files
[TASKSCLOUD-333] - Added tests for vba endpoints.
1 parent 5ad9a30 commit bc7abe0

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

test/test_vba.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#
2+
# --------------------------------------------------------------------------------------------------------------------
3+
# <copyright company="Aspose" file="test_vba.py">
4+
# Copyright (c) 2020 Aspose.Tasks Cloud
5+
# </copyright>
6+
# <summary>
7+
# Permission is hereby granted, free of charge, to any person obtaining a copy
8+
# of this software and associated documentation files (the "Software"), to deal
9+
# in the Software without restriction, including without limitation the rights
10+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
# copies of the Software, and to permit persons to whom the Software is
12+
# furnished to do so, subject to the following conditions:
13+
#
14+
# The above copyright notice and this permission notice shall be included in all
15+
# copies or substantial portions of the Software.
16+
#
17+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
# SOFTWARE.
24+
# </summary>
25+
# --------------------------------------------------------------------------------------------------------------------
26+
#
27+
from asposetaskscloud import GetVbaProjectRequest, VbaProjectResponse
28+
from test.base_test_context import BaseTestContext
29+
30+
31+
class TestVba(BaseTestContext):
32+
33+
def test_get_vba_project(self):
34+
filename = 'VbaProject3.mpp'
35+
self.upload_file(filename)
36+
get_request = GetVbaProjectRequest(filename)
37+
get_result = self.tasks_api.get_vba_project(get_request)
38+
self.assertIsNotNone(get_result)
39+
self.assertIsInstance(get_result, VbaProjectResponse)
40+
self.assertIsNotNone(get_result.vba_project.modules)
41+
self.assertEqual(7, len(get_result.vba_project.modules))
42+
self.assertEqual('Module1', get_result.vba_project.modules[0].name)
43+
self.assertTrue(get_result.vba_project.modules[0].source_code.startswith('Type MEMORYSTATUS'))

0 commit comments

Comments
 (0)