You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
659 B
25 lines
659 B
''' Test package for ordr2.resources ''' |
|
|
|
|
|
import pytest |
|
|
|
|
|
def test_root_resource_init(): |
|
''' test __init__ function of root resource ''' |
|
from ordr2.resources import RootResource |
|
|
|
resource = RootResource('request object') |
|
|
|
assert resource.__name__ is None |
|
assert resource.__parent__ is None |
|
assert resource.request == 'request object' |
|
|
|
|
|
def test_root_resource_acl(): |
|
''' test __acl__ function of root resource ''' |
|
from ordr2.resources import RootResource |
|
from pyramid.security import Allow, Everyone, DENY_ALL |
|
|
|
root = RootResource('request object') |
|
|
|
assert root.__acl__() == [ (Allow, Everyone, 'view'), DENY_ALL ]
|
|
|