Skip to content

Commit fcfd034

Browse files
committed
test: test add_all and check DeprecationWarning
1 parent 1be6693 commit fcfd034

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Diff for: test/test_user.py

+16
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import os
44
from pathlib import Path
55
import unittest
6+
from unittest.mock import patch
67

78
from defusedxml.ElementTree import fromstring
89
import pytest
@@ -403,3 +404,18 @@ def test_bulk_remove(self):
403404
with self.subTest(user=user):
404405
name, *_ = row.split(",")
405406
assert name == f"{user.domain_name}\\{user.name}" if user.domain_name else user.name
407+
408+
def test_add_all(self) -> None:
409+
self.server.version = "2.0"
410+
users = [
411+
make_user("Alice", "Viewer"),
412+
make_user("Bob", "Explorer"),
413+
make_user("Charlie", "Creator", "SAML"),
414+
make_user("Dave"),
415+
]
416+
417+
with patch("tableauserverclient.server.endpoint.users_endpoint.Users.add", autospec=True) as mock_add:
418+
with pytest.warns(DeprecationWarning):
419+
self.server.users.add_all(users)
420+
421+
assert mock_add.call_count == len(users)

0 commit comments

Comments
 (0)