aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTres Seaver <tseaver@palladion.com>2021-06-30 13:33:13 -0400
committerGitHub <noreply@github.com>2021-06-30 13:33:13 -0400
commit1fbee03495a136eef3d6aaa5ea0aadd6e4b58e8b (patch)
tree822b9f29d2126e5a5e5b54c82a96841a145e1f91 /tests
parentd368c4b1a7761b30e7a004dd5f85c5b1edaf1e89 (diff)
downloadpython-api-core-1fbee03495a136eef3d6aaa5ea0aadd6e4b58e8b.tar.gz
fix: undprecate entity factory helpers (#101)
Closes #100
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/test_iam.py48
1 files changed, 6 insertions, 42 deletions
diff --git a/tests/unit/test_iam.py b/tests/unit/test_iam.py
index e783533..fbd242e 100644
--- a/tests/unit/test_iam.py
+++ b/tests/unit/test_iam.py
@@ -230,72 +230,36 @@ class TestPolicy:
assert policy[VIEWER_ROLE] == expected
def test_user(self):
- import warnings
-
EMAIL = "phred@example.com"
MEMBER = "user:%s" % (EMAIL,)
policy = self._make_one()
- with warnings.catch_warnings(record=True) as warned:
- assert policy.user(EMAIL) == MEMBER
-
- (warning,) = warned
- assert warning.category is DeprecationWarning
+ assert policy.user(EMAIL) == MEMBER
def test_service_account(self):
- import warnings
-
EMAIL = "phred@example.com"
MEMBER = "serviceAccount:%s" % (EMAIL,)
policy = self._make_one()
- with warnings.catch_warnings(record=True) as warned:
- assert policy.service_account(EMAIL) == MEMBER
-
- (warning,) = warned
- assert warning.category is DeprecationWarning
+ assert policy.service_account(EMAIL) == MEMBER
def test_group(self):
- import warnings
-
EMAIL = "phred@example.com"
MEMBER = "group:%s" % (EMAIL,)
policy = self._make_one()
- with warnings.catch_warnings(record=True) as warned:
- assert policy.group(EMAIL) == MEMBER
-
- (warning,) = warned
- assert warning.category is DeprecationWarning
+ assert policy.group(EMAIL) == MEMBER
def test_domain(self):
- import warnings
-
DOMAIN = "example.com"
MEMBER = "domain:%s" % (DOMAIN,)
policy = self._make_one()
- with warnings.catch_warnings(record=True) as warned:
- assert policy.domain(DOMAIN) == MEMBER
-
- (warning,) = warned
- assert warning.category is DeprecationWarning
+ assert policy.domain(DOMAIN) == MEMBER
def test_all_users(self):
- import warnings
-
policy = self._make_one()
- with warnings.catch_warnings(record=True) as warned:
- assert policy.all_users() == "allUsers"
-
- (warning,) = warned
- assert warning.category is DeprecationWarning
+ assert policy.all_users() == "allUsers"
def test_authenticated_users(self):
- import warnings
-
policy = self._make_one()
- with warnings.catch_warnings(record=True) as warned:
- assert policy.authenticated_users() == "allAuthenticatedUsers"
-
- (warning,) = warned
- assert warning.category is DeprecationWarning
+ assert policy.authenticated_users() == "allAuthenticatedUsers"
def test_from_api_repr_only_etag(self):
empty = frozenset()