forked from tableau/server-client-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_tableauauth_model.py
More file actions
25 lines (19 loc) · 867 Bytes
/
test_tableauauth_model.py
File metadata and controls
25 lines (19 loc) · 867 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
import unittest
import warnings
import tableauserverclient as TSC
class TableauAuthModelTests(unittest.TestCase):
def setUp(self):
self.auth = TSC.TableauAuth('user',
'password',
site_id='site1',
user_id_to_impersonate='admin')
def test_username_password_required(self):
with self.assertRaises(TypeError):
TSC.TableauAuth()
def test_site_arg_raises_warning(self):
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
tableau_auth = TSC.TableauAuth('user',
'password',
site='Default')
self.assertTrue(any(item.category == DeprecationWarning for item in w))