Skip to content

Commit 9195acd

Browse files
[TASKSCLOUD-337] - Added tests for wbs endpoints.
1 parent bc7abe0 commit 9195acd

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

test/test_wbs.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#
2+
# --------------------------------------------------------------------------------------------------------------------
3+
# <copyright company="Aspose" file="test_wbs.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 GetWbsDefinitionRequest, WBSDefinitionResponse, PutRenumberWbsCodeRequest, AsposeResponse
28+
from test.base_test_context import BaseTestContext
29+
30+
31+
class TestWbs(BaseTestContext):
32+
33+
def test_get_wbs_definition(self):
34+
filename = 'WBSDefinition.mpp'
35+
self.upload_file(filename)
36+
get_request = GetWbsDefinitionRequest(filename)
37+
get_result = self.tasks_api.get_wbs_definition(get_request)
38+
self.assertIsNotNone(get_result)
39+
self.assertIsInstance(get_result, WBSDefinitionResponse)
40+
self.assertIsNotNone(get_result.wbs_definition)
41+
self.assertTrue(get_result.wbs_definition.generate_wbs_code)
42+
self.assertTrue(get_result.wbs_definition.verify_uniqueness)
43+
44+
def test_put_renumber_wbs_code(self):
45+
filename = 'WBSDefinition.mpp'
46+
self.upload_file(filename)
47+
get_request = PutRenumberWbsCodeRequest(filename, [])
48+
get_result = self.tasks_api.put_renumber_wbs_code(get_request)
49+
self.assertIsNotNone(get_result)
50+
self.assertIsInstance(get_result, AsposeResponse)

0 commit comments

Comments
 (0)