Exemplo n.º 1
0
 def test_allow_binding_perms_after_data(self):
     bound = self.schema.bind(data=schema.ResourceSchema())
     permissions = schema.PermissionsSchema(permissions=("sleep", ))
     bound = bound.bind(permissions=permissions)
     value = {"data": {"foo": "bar"}, "permissions": {"sleep": []}}
     deserialized = bound.deserialize(value)
     self.assertEqual(deserialized, value)
Exemplo n.º 2
0
 def test_allow_binding_perms_after_data(self):
     bound = self.schema.bind(data=schema.ResourceSchema())
     permissions = schema.PermissionsSchema(permissions=('sleep', ))
     bound = bound.bind(permissions=permissions)
     value = {'data': {'foo': 'bar'}, 'permissions': {'sleep': []}}
     deserialized = bound.deserialize(value)
     self.assertEquals(deserialized, value)
Exemplo n.º 3
0
 def setUp(self):
     self.schema = schema.PermissionsSchema()
Exemplo n.º 4
0
 def test_binds_permissions(self):
     permissions = schema.PermissionsSchema(permissions=("sleep", ))
     bound = self.schema.bind(permissions=permissions)
     value = {"permissions": {"sleep": []}}
     deserialized = bound.deserialize(value)
     self.assertEqual(deserialized, value)
Exemplo n.º 5
0
 def test_binds_permissions(self):
     permissions = schema.PermissionsSchema(permissions=('sleep', ))
     bound = self.schema.bind(permissions=permissions)
     value = {'permissions': {'sleep': []}}
     deserialized = bound.deserialize(value)
     self.assertEquals(deserialized, value)