Skip to content

Commit 48f645e

Browse files
committed
fixed eventually_consistent usage
1 parent 0b3821b commit 48f645e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

kms/api-client/snippets_test.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,7 @@ def test_key_policy(self):
180180
self.member,
181181
self.role)
182182

183-
@eventually_consistent.call(exceptions=[Aborted, AssertionError])
184-
def _():
183+
def check_policy():
185184
policy = snippets.get_crypto_key_policy(self.project_id,
186185
self.location,
187186
self.keyring_id,
@@ -191,6 +190,8 @@ def _():
191190
if b.role == self.role and self.member in b.members:
192191
found = True
193192
assert found
193+
eventually_consistent.call(check_policy,
194+
exceptions=[Aborted, AssertionError])
194195
# remove member
195196
snippets.remove_member_from_crypto_key_policy(self.project_id,
196197
self.location,
@@ -199,8 +200,7 @@ def _():
199200
self.member,
200201
self.role)
201202

202-
@eventually_consistent.call(exceptions=[Aborted, AssertionError])
203-
def _():
203+
def check_policy():
204204
policy = snippets.get_crypto_key_policy(self.project_id,
205205
self.location,
206206
self.keyring_id,
@@ -210,6 +210,8 @@ def _():
210210
if b.role == self.role and self.member in b.members:
211211
found = True
212212
assert not found
213+
eventually_consistent.call(check_policy,
214+
exceptions=[Aborted, AssertionError])
213215

214216
def test_symmetric_encrypt_decrypt(self):
215217
cipher_bytes = snippets.encrypt_symmetric(self.project_id,

0 commit comments

Comments
 (0)