Skip to content

Commit

Permalink
Merge pull request #4442 from hypothesis/refactor-worldgroup-tests
Browse files Browse the repository at this point in the history
Refactor session and WorldGroup tests
  • Loading branch information
chdorner authored Mar 20, 2017
2 parents 851913a + d8e627f commit 732dc4d
Show file tree
Hide file tree
Showing 2 changed files with 158 additions and 190 deletions.
40 changes: 18 additions & 22 deletions tests/h/groups/util_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,30 @@

from __future__ import unicode_literals

import pytest

from pyramid import security

from h.groups import util


def test_world_group_acl():
group = util.WorldGroup('example.com')

assert group.__acl__() == [
(security.Allow, security.Everyone, 'read'),
(security.Allow, 'authority:example.com', 'write'),
security.DENY_ALL,
]


def test_world_group_name():
group = util.WorldGroup('example.com')

assert group.name == 'Public'


def test_world_group_pubid():
group = util.WorldGroup('example.com')
class TestWorldGroup(object):
def test_acl(self, group):
assert group.__acl__() == [
(security.Allow, security.Everyone, 'read'),
(security.Allow, 'authority:example.com', 'write'),
security.DENY_ALL,
]

assert group.pubid == '__world__'
def test_name(self, group):
assert group.name == 'Public'

def test_pubid(self, group):
assert group.pubid == '__world__'

def test_world_group_is_public():
group = util.WorldGroup('example.com')
def test_is_public(self, group):
assert group.is_public

assert group.is_public
@pytest.fixture
def group(self):
return util.WorldGroup('example.com')
Loading

0 comments on commit 732dc4d

Please sign in to comment.