forked from tableau/server-client-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_project_model.py
More file actions
30 lines (23 loc) · 954 Bytes
/
test_project_model.py
File metadata and controls
30 lines (23 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import unittest
import tableauserverclient as TSC
class ProjectModelTests(unittest.TestCase):
def test_invalid_name(self):
self.assertRaises(ValueError, TSC.ProjectItem, None)
self.assertRaises(ValueError, TSC.ProjectItem, "")
project = TSC.ProjectItem("proj")
with self.assertRaises(ValueError):
project.name = None
with self.assertRaises(ValueError):
project.name = ""
def test_invalid_content_permissions(self):
project = TSC.ProjectItem("proj")
with self.assertRaises(ValueError):
project.content_permissions = "Hello"
def test_parent_id(self):
project = TSC.ProjectItem("proj")
project.parent_id = "foo"
self.assertEqual(project.parent_id, "foo")
def test_owner_id(self):
project = TSC.ProjectItem("proj")
with self.assertRaises(NotImplementedError):
project.owner_id = "new_owner"