diff options
author | Tres Seaver <tseaver@palladion.com> | 2021-06-16 13:45:41 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-16 13:45:41 -0400 |
commit | fbf447cf25468dfa7e99283ce66a9c10daacc488 (patch) | |
tree | 3f6725ebb6ecf81dc502cdf71ec2da174076e32a /tests/unit/test_iam.py | |
parent | 11032cf08ecc16dd252a6cda8b33b0b28ec4f4ba (diff) | |
download | python-api-core-fbf447cf25468dfa7e99283ce66a9c10daacc488.tar.gz |
chore: blacken (#206)
Also, fix 2.7 tests broken by release of 'googleapis-common-protos 1.53.0',
which dropped Python 2.7 support.
Closes #169
Diffstat (limited to 'tests/unit/test_iam.py')
-rw-r--r-- | tests/unit/test_iam.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/unit/test_iam.py b/tests/unit/test_iam.py index 0da9b23..e783533 100644 --- a/tests/unit/test_iam.py +++ b/tests/unit/test_iam.py @@ -57,6 +57,7 @@ class TestPolicy: def test__getitem___and_set(self): from google.api_core.iam import OWNER_ROLE + policy = self._make_one() # get the policy using the getter and then modify it @@ -120,7 +121,7 @@ class TestPolicy: policy = self._make_one() policy.bindings = [ {"role": "to/keep", "members": set(["phred@example.com"])}, - {"role": "to/remove", "members": set(["phred@example.com"])} + {"role": "to/remove", "members": set(["phred@example.com"])}, ] del policy["to/remove"] assert len(policy) == 1 @@ -150,7 +151,9 @@ class TestPolicy: USER = "user:phred@example.com" CONDITION = {"expression": "2 > 1"} policy = self._make_one() - BINDINGS = [{"role": "role/reader", "members": set([USER]), "condition": CONDITION}] + BINDINGS = [ + {"role": "role/reader", "members": set([USER]), "condition": CONDITION} + ] policy.bindings = BINDINGS assert policy.bindings == BINDINGS @@ -394,13 +397,17 @@ class TestPolicy: CONDITION = { "title": "title", "description": "description", - "expression": "true" + "expression": "true", } BINDINGS = [ {"role": OWNER_ROLE, "members": [OWNER1, OWNER2]}, {"role": EDITOR_ROLE, "members": [EDITOR1, EDITOR2]}, {"role": VIEWER_ROLE, "members": [VIEWER1, VIEWER2]}, - {"role": VIEWER_ROLE, "members": [VIEWER1, VIEWER2], "condition": CONDITION}, + { + "role": VIEWER_ROLE, + "members": [VIEWER1, VIEWER2], + "condition": CONDITION, + }, ] policy = self._make_one("DEADBEEF", 1) policy.bindings = BINDINGS |