Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coverage for gcloud.storage #144

Merged
merged 19 commits into from
Sep 23, 2014
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix NameError in 'entity_from_dict' edge case.
  • Loading branch information
tseaver committed Sep 18, 2014
commit b15d1e4571a9dc63a9215bd75262e0e34332d78e
2 changes: 1 addition & 1 deletion gcloud/storage/acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def entity_from_dict(self, entity_dict):
entity = self.entity(type=type, identifier=identifier)

if not isinstance(entity, ACL.Entity):
raise ValueError('Invalid dictionary: %s' % acl_dict)
raise ValueError('Invalid dictionary: %s' % entity_dict)

return entity.grant(role)

Expand Down
7 changes: 7 additions & 0 deletions gcloud/storage/test_acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,10 @@ def test_entity_from_dict_string_w_hyphen(self):
self.assertEqual(entity.get_roles(), set([ROLE]))
self.assertEqual(list(acl),
[{'entity': 'type-id', 'role': ROLE}])

def test_entity_from_dict_string_wo_hyphen(self):
ROLE = 'role'
acl = self._makeOne()
self.assertRaises(ValueError,
acl.entity_from_dict,
{'entity': 'bogus', 'role': ROLE})