Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes | Static Public Attributes
MoinMoin._tests.test_PageEditor.TestExpandPrivateVariables Class Reference
Inheritance diagram for MoinMoin._tests.test_PageEditor.TestExpandPrivateVariables:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin._tests.test_PageEditor.TestExpandPrivateVariables:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def setup_method
def teardown_method
def testPrivateVariables
def createTestPage
def deleteCaches
def deleteTestPage
def dictPagePath
def expand

Public Attributes

 savedValid
 page
 savedName

Static Public Attributes

string variable = u'@ME@'
string name = u'AutoCreatedMoinMoinTemporaryTestUser'
string dictPage = '/MyDict'
 shouldDeleteTestPage = True
string pagename = u'AutoCreatedMoinMoinTemporaryTestPage'

Detailed Description

Definition at line 102 of file test_PageEditor.py.


Member Function Documentation

Create temporary page, bypass logs, notification and backups

TODO: this code is very fragile, any change in the
implementation will break this test. Need to factor PageEditor
to make it possible to create page without loging and notifying.

Definition at line 125 of file test_PageEditor.py.

00125 
00126     def createTestPage(self):
00127         """ Create temporary page, bypass logs, notification and backups
00128 
00129         TODO: this code is very fragile, any change in the
00130         implementation will break this test. Need to factor PageEditor
00131         to make it possible to create page without loging and notifying.
00132         """
00133         import os
00134         path = self.dictPagePath()
00135         if os.path.exists(path):
00136             self.shouldDeleteTestPage = False
00137             py.test.skip("%s exists. Won't overwrite exiting page" % self.dictPage)
00138         try:
00139             os.mkdir(path)
00140             revisionsDir = os.path.join(path, 'revisions')
00141             os.mkdir(revisionsDir)
00142             current = '00000001'
00143             file(os.path.join(path, 'current'), 'w').write('%s\n' % current)
00144             text = u' ME:: %s\n' % self.name
00145             file(os.path.join(revisionsDir, current), 'w').write(text)
00146         except Exception, err:
00147             py.test.skip("Can not be create test page: %s" % err)

Here is the call graph for this function:

Here is the caller graph for this function:

Force the wiki to scan the test page into the dicts 

Definition at line 148 of file test_PageEditor.py.

00148 
00149     def deleteCaches(self):
00150         """ Force the wiki to scan the test page into the dicts """
00151         # New dicts does not require cache refresh.

Delete temporary page, bypass logs and notifications 

Definition at line 152 of file test_PageEditor.py.

00152 
00153     def deleteTestPage(self):
00154         """ Delete temporary page, bypass logs and notifications """
00155         if self.shouldDeleteTestPage:
00156             import shutil
00157             shutil.rmtree(self.dictPagePath(), True)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 158 of file test_PageEditor.py.

00158 
00159     def dictPagePath(self):
00160         page = Page(self.request, self.dictPage)
00161         return page.getPagePath(use_underlay=0, check_create=0)
00162 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 57 of file test_PageEditor.py.

00057 
00058     def expand(self):
00059         return self.page._expand_variables(self.variable)
00060 

Here is the caller graph for this function:

Reimplemented from MoinMoin._tests.test_PageEditor.TestExpandUserName.

Definition at line 109 of file test_PageEditor.py.

00109 
00110     def setup_method(self, method):
00111         super(TestExpandPrivateVariables, self).setup_method(method)
00112         self.savedValid = self.request.user.valid
00113         self.request.user.valid = 1
00114         self.createTestPage()
00115         self.deleteCaches()

Reimplemented from MoinMoin._tests.test_PageEditor.TestExpandUserName.

Definition at line 116 of file test_PageEditor.py.

00116 
00117     def teardown_method(self, method):
00118         super(TestExpandPrivateVariables, self).teardown_method(method)
00119         self.request.user.valid = self.savedValid
00120         self.deleteTestPage()

Here is the call graph for this function:

PageEditor: expand user variables 

Definition at line 121 of file test_PageEditor.py.

00121 
00122     def testPrivateVariables(self):
00123         """ PageEditor: expand user variables """
00124         assert self.expand() == self.name

Here is the call graph for this function:


Member Data Documentation

Definition at line 106 of file test_PageEditor.py.

string MoinMoin._tests.test_PageEditor.TestExpandPrivateVariables.name = u'AutoCreatedMoinMoinTemporaryTestUser' [static]

Definition at line 105 of file test_PageEditor.py.

Definition at line 50 of file test_PageEditor.py.

string MoinMoin._tests.test_PageEditor.TestExpandUserName.pagename = u'AutoCreatedMoinMoinTemporaryTestPage' [static, inherited]

Definition at line 46 of file test_PageEditor.py.

Definition at line 51 of file test_PageEditor.py.

Definition at line 111 of file test_PageEditor.py.

Definition at line 107 of file test_PageEditor.py.

Reimplemented from MoinMoin._tests.test_PageEditor.TestExpandUserName.

Definition at line 104 of file test_PageEditor.py.


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