Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
CMFPlone.tests.testWebDAV.TestDAVOperations Class Reference
Inheritance diagram for CMFPlone.tests.testWebDAV.TestDAVOperations:
Inheritance graph
[legend]
Collaboration diagram for CMFPlone.tests.testWebDAV.TestDAVOperations:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def test_document_propfind_index_html_exist_folder
def test_document_propfind_index_html_non_exist_folder
def test_document_propfind_index_html_exist_portal
def test_document_propfind_index_html_non_exist_portal
def test_propfind_portal_root_index_html_exists
def test_propfind_portal_root_index_html_not_exists
def test_propfind_folder_index_html_exists
def test_propfind_folder_index_html_not_exists
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 basic_auth
 portal_path
 folder_path

Detailed Description

Definition at line 284 of file testWebDAV.py.


Member Function Documentation

Definition at line 286 of file testWebDAV.py.

00286 
00287     def afterSetUp(self):
00288         self.loginAsPortalOwner()
00289         self.basic_auth = '%s:%s' % (PloneTestCase.portal_owner, PloneTestCase.default_password)
00290         self.portal_path = self.portal.absolute_url(1)
00291         self.folder_path = self.folder.absolute_url(1)

Here is the call graph for this function:

Definition at line 30 of file PloneTestCase.py.

00030 
00031     def getAuthenticator(self):
00032         tag = AuthenticatorView('context', 'request').authenticator()
00033         pattern = '<input .*name="(\w+)".*value="(\w+)"'
00034         return match(pattern, tag).groups()

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFPlone.tests.PloneTestCase.PloneTestCase.setRequestMethod (   self,
  method 
) [inherited]
This is a stub now, but in case you want to try
   something fancy on Your Branch (tm), put it here.

Definition at line 26 of file PloneTestCase.py.

00026 
00027     def setRequestMethod(self, method):
00028         self.app.REQUEST.set('REQUEST_METHOD', method)
00029         self.app.REQUEST.method = method

Here is the caller graph for this function:

Definition at line 35 of file PloneTestCase.py.

00035 
00036     def setupAuthenticator(self):
00037         name, token = self.getAuthenticator()
00038         self.app.REQUEST.form[name] = token
00039 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 292 of file testWebDAV.py.

00292 
00293     def test_document_propfind_index_html_exist_folder(self):
00294         self.folder.invokeFactory('Folder', 'sub')
00295         self.folder.sub.invokeFactory('Document', 'index_html')
00296         self.failUnless('index_html' in self.folder.sub.objectIds())
00297 
00298         # Do a PROPFIND on folder/index_html, this needs to result in a 207
00299         response = self.publish(self.folder_path + '/sub/index_html',
00300                                 request_method='PROPFIND',
00301                                 env={'HTTP_DEPTH': '0'},
00302                                 stdin=StringIO(),
00303                                 basic=self.basic_auth)
00304 
00305         self.assertEqual(response.getStatus(), 207, response.getBody())

Definition at line 319 of file testWebDAV.py.

00319 
00320     def test_document_propfind_index_html_exist_portal(self):
00321         if 'index_html' not in self.portal.objectIds():
00322             self.portal.invokeFactory('Document', 'index_html')
00323 
00324         self.failUnless('index_html' in self.portal.objectIds())
00325 
00326         # Do a PROPFIND on folder/index_html, this needs to result in a 207
00327         response = self.publish(self.portal_path + '/index_html',
00328                                 request_method='PROPFIND',
00329                                 env={'HTTP_DEPTH': '0'},
00330                                 stdin=StringIO(),
00331                                 basic=self.basic_auth)
00332 
00333         self.assertEqual(response.getStatus(), 207, response.getBody())

Definition at line 306 of file testWebDAV.py.

00306 
00307     def test_document_propfind_index_html_non_exist_folder(self):
00308         self.folder.invokeFactory('Folder', 'sub')
00309         self.failIf('index_html' in self.folder.sub.objectIds())
00310 
00311         # Do a PROPFIND on folder/index_html, this needs to result in a NotFound.
00312         response = self.publish(self.folder_path + '/sub/index_html',
00313                                 request_method='PROPFIND',
00314                                 env={'HTTP_DEPTH': '0'},
00315                                 stdin=StringIO(),
00316                                 basic=self.basic_auth)
00317 
00318         self.assertEqual(response.getStatus(), 404, response.getBody())

Definition at line 334 of file testWebDAV.py.

00334 
00335     def test_document_propfind_index_html_non_exist_portal(self):
00336         if 'index_html' in self.portal.objectIds():
00337             self.portal.manage_delObjects('index_html')
00338 
00339         self.failIf('index_html' in self.portal.objectIds())
00340 
00341         # Do a PROPFIND on portal/index_html, this needs to result in a NotFound.
00342         response = self.publish(self.portal_path + '/index_html',
00343                                 request_method='PROPFIND',
00344                                 env={'HTTP_DEPTH': '0'},
00345                                 stdin=StringIO(),
00346                                 basic=self.basic_auth)
00347 
00348         self.assertEqual(response.getStatus(), 404, response.getBody())

Definition at line 379 of file testWebDAV.py.

00379 
00380     def test_propfind_folder_index_html_exists(self):
00381         if 'index_html' not in self.folder.objectIds():
00382             self.folder.invokeFactory('Document', 'index_html')
00383 
00384         self.failUnless('index_html' in self.folder.objectIds())
00385 
00386         # Do a PROPFIND on folder, this needs to result in a 207
00387         response = self.publish(self.folder_path,
00388                                 request_method='PROPFIND',
00389                                 env={'HTTP_DEPTH': '0'},
00390                                 stdin=StringIO(),
00391                                 basic=self.basic_auth)
00392 
00393         self.assertEqual(response.getStatus(), 207, response.getBody())

Definition at line 394 of file testWebDAV.py.

00394 
00395     def test_propfind_folder_index_html_not_exists(self):
00396         if 'index_html' in self.folder.objectIds():
00397             self.folder.manage_delObjects('index_html')
00398 
00399         self.failIf('index_html' in self.folder.objectIds())
00400 
00401         # Do a PROPFIND on folder, this needs to result in a 207
00402         response = self.publish(self.folder_path,
00403                                 request_method='PROPFIND',
00404                                 env={'HTTP_DEPTH': '0'},
00405                                 stdin=StringIO(),
00406                                 basic=self.basic_auth)
00407 
00408         self.assertEqual(response.getStatus(), 207, response.getBody())
00409 

Definition at line 349 of file testWebDAV.py.

00349 
00350     def test_propfind_portal_root_index_html_exists(self):
00351         if 'index_html' not in self.portal.objectIds():
00352             self.portal.invokeFactory('Document', 'index_html')
00353 
00354         self.failUnless('index_html' in self.portal.objectIds())
00355 
00356         # Do a PROPFIND on portal, this needs to result in a 207
00357         response = self.publish(self.portal_path,
00358                                 request_method='PROPFIND',
00359                                 env={'HTTP_DEPTH': '0'},
00360                                 stdin=StringIO(),
00361                                 basic=self.basic_auth)
00362 
00363         self.assertEqual(response.getStatus(), 207, response.getBody())

Definition at line 364 of file testWebDAV.py.

00364 
00365     def test_propfind_portal_root_index_html_not_exists(self):
00366         if 'index_html' in self.portal.objectIds():
00367             self.portal.manage_delObjects('index_html')
00368 
00369         self.failIf('index_html' in self.portal.objectIds())
00370 
00371         # Do a PROPFIND on portal, this needs to result in a 207
00372         response = self.publish(self.portal_path,
00373                                 request_method='PROPFIND',
00374                                 env={'HTTP_DEPTH': '0'},
00375                                 stdin=StringIO(),
00376                                 basic=self.basic_auth)
00377 
00378         self.assertEqual(response.getStatus(), 207, response.getBody())


Member Data Documentation

Definition at line 288 of file testWebDAV.py.

Definition at line 290 of file testWebDAV.py.

Definition at line 289 of file testWebDAV.py.


The documentation for this class was generated from the following file: