Exemplo n.º 1
0
 def test_options_root(self):
     path = '/'
     v = DavView(path=path, acl_class=FullAcl)
     v.__dict__['resource'] = MockObject(path)
     resp = v.options(None, path)
     self.assertEqual(sorted(resp.items()), [
         ('Content-Length', '0'),
         ('Content-Type', 'text/xml; charset="utf-8"'),
         ('DAV', '1,2'),
     ])
Exemplo n.º 2
0
 def test_options_root(self):
     path = '/'
     v = DavView(path=path, acl_class=FullAcl)
     v.__dict__['resource'] = MockObject(path)
     resp = v.options(None, path)
     self.assertEqual(sorted(resp.items()), [
         ('Content-Length', '0'),
         ('Content-Type', 'text/xml; charset="utf-8"'),
         ('DAV', '1,2'),
     ])
Exemplo n.º 3
0
 def test_options_collection(self):
     path = '/collection/'
     v = DavView(path=path, _allowed_methods=Mock(return_value=['ALL']), acl_class=FullAcl)
     v.__dict__['resource'] = MockCollection(path)
     resp = v.options(None, path)
     self.assertEqual(sorted(resp.items()), [
         ('Allow', 'ALL'),
         ('Content-Length', '0'),
         ('Content-Type', 'text/xml; charset="utf-8"'),
         ('DAV', '1,2'),
     ])
Exemplo n.º 4
0
 def test_options_collection(self):
     path = '/collection/'
     v = DavView(path=path, _allowed_methods=Mock(return_value=['ALL']), acl_class=FullAcl)
     v.__dict__['resource'] = MockCollection(path)
     resp = v.options(None, path)
     self.assertEqual(sorted(resp.items()), [
         ('Allow', 'ALL'),
         ('Content-Length', '0'),
         ('Content-Type', 'text/xml; charset="utf-8"'),
         ('DAV', '1,2'),
     ])
Exemplo n.º 5
0
 def test_options_obj(self):
     path = '/obj'
     v = DavView(path=path, _allowed_methods=Mock(return_value=['ALL']), acl_class=FullAcl)
     v.__dict__['resource'] = MockObject(path)
     resp = v.options(None, path)
     self.assertEqual(sorted(resp.items()), [
         ('Allow', 'ALL'),
         ('Allow-Ranges', 'bytes'),
         ('Content-Length', '0'),
         ('Content-Type', 'text/html'),
         ('DAV', '1,2'),
     ])