8000 101 test tableauauth model.py (#134) · williamlang/server-client-python@8d54ac8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8d54ac8

Browse files
talvalint8y8
authored andcommitted
101 test tableauauth model.py (tableau#134)
Improve coverage in the auth model tests. Original patch by @talvalin
1 parent 4700dda commit 8d54ac8

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/test_tableauauth_model.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import unittest
2+
import warnings
3+
import tableauserverclient as TSC
4+
5+
6+
class TableauAuthModelTests(unittest.TestCase):
7+
def setUp(self):
8+
self.auth = TSC.TableauAuth('user',
9+
'password',
10+
site_id='site1',
11+
user_id_to_impersonate='admin')
12+
13+
def test_username_password_required(self):
14+
with self.assertRaises(TypeError):
15+
TSC.TableauAuth()
16+
17+
def test_site_arg_raises_warning(self):
18+
with warnings.catch_warnings(record=True) as w:
19+
warnings.simplefilter("always")
20+
21+
tableau_auth = TSC.TableauAuth('user',
22+
'password',
23+
site='Default')
24+
25+
self.assertTrue(any(item.category == DeprecationWarning for item in w))

0 commit comments

Comments
 (0)
0