Skip to content

Commit

Permalink
fill test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jkwlui committed Jan 7, 2020
1 parent 6931900 commit da80589
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions api_core/tests/unit/test_iam.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,16 +381,19 @@ def test_to_api_repr_full(self):
EDITOR2 = "user:phred@example.com"
VIEWER1 = "serviceAccount:1234-abcdef@service.example.com"
VIEWER2 = "user:phred@example.com"
CONDITION = {
"title": "title",
"description": "description",
"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},
]
policy = self._make_one("DEADBEEF", 1)
with warnings.catch_warnings(record=True):
policy.owners = [OWNER1, OWNER2]
policy.editors = [EDITOR1, EDITOR2]
policy.viewers = [VIEWER1, VIEWER2]
policy.bindings = BINDINGS
resource = policy.to_api_repr()
assert resource["etag"] == "DEADBEEF"
assert resource["version"] == 1
Expand Down

0 comments on commit da80589

Please sign in to comment.