Skip to content

Commit

Permalink
improve test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jkwlui committed Jan 9, 2020
1 parent f84ea6f commit ef37fde
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions api_core/tests/unit/test_iam.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,18 @@ def test___setitem__(self):
assert dict(policy) == {"rolename": PRINCIPALS}

def test__set_item__overwrite(self):
GROUP = "group:test@group.com"
USER = "user:phred@example.com"
ALL_USERS = "allUsers"
MEMBERS = set([ALL_USERS])
GROUPS = set([GROUP])
policy = self._make_one()
policy["rolename"] = [USER]
policy["rolename"] = [ALL_USERS]
assert policy["rolename"] == MEMBERS
assert len(policy) == 1
assert dict(policy) == {"rolename": MEMBERS}
policy["first"] = [GROUP]
policy["second"] = [USER]
policy["second"] = [ALL_USERS]
assert policy["second"] == MEMBERS
assert len(policy) == 2
assert dict(policy) == {"first": GROUPS, "second": MEMBERS}

def test___setitem___version3(self):
policy = self._make_one("DEADBEEF", 3)
Expand Down

0 comments on commit ef37fde

Please sign in to comment.