1717
1818
1919class ProjectTests (unittest .TestCase ):
20- def setUp (self ):
20+ def setUp (self ) -> None :
2121 self .server = TSC .Server ("http://test" )
2222
2323 # Fake signin
@@ -26,7 +26,7 @@ def setUp(self):
2626
2727 self .baseurl = self .server .projects .baseurl
2828
29- def test_get (self ):
29+ def test_get (self ) -> None :
3030 with open (GET_XML , "rb" ) as f :
3131 response_xml = f .read ().decode ("utf-8" )
3232 with requests_mock .mock () as m :
@@ -53,19 +53,19 @@ def test_get(self):
5353 self .assertEqual ("1d0304cd-3796-429f-b815-7258370b9b74" , all_projects [2 ].parent_id )
5454 self .assertEqual ("dd2239f6-ddf1-4107-981a-4cf94e415794" , all_projects [2 ].owner_id )
5555
56- def test_get_before_signin (self ):
56+ def test_get_before_signin (self ) -> None :
5757 self .server ._auth_token = None
5858 self .assertRaises (TSC .NotSignedInError , self .server .projects .get )
5959
60- def test_delete (self ):
60+ def test_delete (self ) -> None :
6161 with requests_mock .mock () as m :
6262 m .delete (self .baseurl + "/ee8c6e70-43b6-11e6-af4f-f7b0d8e20760" , status_code = 204 )
6363 self .server .projects .delete ("ee8c6e70-43b6-11e6-af4f-f7b0d8e20760" )
6464
65- def test_delete_missing_id (self ):
65+ def test_delete_missing_id (self ) -> None :
6666 self .assertRaises (ValueError , self .server .projects .delete , "" )
6767
68- def test_update (self ):
68+ def test_update (self ) -> None :
6969 with open (UPDATE_XML , "rb" ) as f :
7070 response_xml = f .read ().decode ("utf-8" )
7171 with requests_mock .mock () as m :
@@ -85,7 +85,7 @@ def test_update(self):
8585 self .assertEqual ("LockedToProject" , single_project .content_permissions )
8686 self .assertEqual ("9a8f2265-70f3-4494-96c5-e5949d7a1120" , single_project .parent_id )
8787
88- def test_content_permission_locked_to_project_without_nested (self ):
88+ def test_content_permission_locked_to_project_without_nested (self ) -> None :
8989 with open (SET_CONTENT_PERMISSIONS_XML , "rb" ) as f :
9090 response_xml = f .read ().decode ("utf-8" )
9191 with requests_mock .mock () as m :
@@ -104,7 +104,7 @@ def test_content_permission_locked_to_project_without_nested(self):
104104 self .assertEqual ("LockedToProjectWithoutNested" , project_item .content_permissions )
105105 self .assertEqual ("7687bc43-a543-42f3-b86f-80caed03a813" , project_item .parent_id )
106106
107- def test_update_datasource_default_permission (self ):
107+ def test_update_datasource_default_permission (self ) -> None :
108108 response_xml = read_xml_asset (UPDATE_DATASOURCE_DEFAULT_PERMISSIONS_XML )
109109 with requests_mock .mock () as m :
110110 m .put (
@@ -132,11 +132,11 @@ def test_update_datasource_default_permission(self):
132132 self .assertEqual ("Allow" , updated_capabilities ["Write" ])
133133 self .assertEqual ("Allow" , updated_capabilities ["Connect" ])
134134
135- def test_update_missing_id (self ):
135+ def test_update_missing_id (self ) -> None :
136136 single_project = TSC .ProjectItem ("test" )
137137 self .assertRaises (TSC .MissingRequiredFieldError , self .server .projects .update , single_project )
138138
139- def test_create (self ):
139+ def test_create (self ) -> None :
140140 with open (CREATE_XML , "rb" ) as f :
141141 response_xml = f .read ().decode ("utf-8" )
142142 with requests_mock .mock () as m :
@@ -152,10 +152,10 @@ def test_create(self):
152152 self .assertEqual ("ManagedByOwner" , new_project .content_permissions )
153153 self .assertEqual ("9a8f2265-70f3-4494-96c5-e5949d7a1120" , new_project .parent_id )
154154
155- def test_create_missing_name (self ):
155+ def test_create_missing_name (self ) -> None :
156156 self .assertRaises (ValueError , TSC .ProjectItem , "" )
157157
158- def test_populate_permissions (self ):
158+ def test_populate_permissions (self ) -> None :
159159 with open (asset (POPULATE_PERMISSIONS_XML ), "rb" ) as f :
160160 response_xml = f .read ().decode ("utf-8" )
161161 with requests_mock .mock () as m :
@@ -176,7 +176,7 @@ def test_populate_permissions(self):
176176 },
177177 )
178178
179- def test_populate_workbooks (self ):
179+ def test_populate_workbooks (self ) -> None :
180180 response_xml = read_xml_asset (POPULATE_WORKBOOK_DEFAULT_PERMISSIONS_XML )
181181 with requests_mock .mock () as m :
182182 m .get (
@@ -213,7 +213,7 @@ def test_populate_workbooks(self):
213213 },
214214 )
215215
216- def test_delete_permission (self ):
216+ def test_delete_permission (self ) -> None :
217217 with open (asset (POPULATE_PERMISSIONS_XML ), "rb" ) as f :
218218 response_xml = f .read ().decode ("utf-8" )
219219 with requests_mock .mock () as m :
@@ -242,7 +242,7 @@ def test_delete_permission(self):
242242 m .delete ("{}/{}/Write/Allow" .format (self .baseurl , endpoint ), status_code = 204 )
243243 self .server .projects .delete_permission (item = single_project , rules = rules )
244244
245- def test_delete_workbook_default_permission (self ):
245+ def test_delete_workbook_default_permission (self ) -> None :
246246 with open (asset (POPULATE_WORKBOOK_DEFAULT_PERMISSIONS_XML ), "rb" ) as f :
247247 response_xml = f .read ().decode ("utf-8" )
248248
0 commit comments