Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions
test_PageHits.TestHits Class Reference
Collaboration diagram for test_PageHits.TestHits:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def setup_class
def teardown_class
def testPageHits

Public Attributes

 page

Static Public Attributes

string pagename = u'AutoCreatedMoinMoinTemporaryTestPageForPageHits'

Private Member Functions

def _test_macro

Detailed Description

Hits: testing Hits macro 

Definition at line 17 of file test_PageHits.py.


Member Function Documentation

def test_PageHits.TestHits._test_macro (   self,
  name,
  args 
) [private]

Definition at line 34 of file test_PageHits.py.

00034 
00035     def _test_macro(self, name, args):
00036         m = make_macro(self.request, self.page)
00037         return m.execute(name, args)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 21 of file test_PageHits.py.

00021 
00022     def setup_class(self):
00023         request = self.request
00024         become_trusted(request)
00025         self.page = create_page(request, self.pagename, u"Foo!")
00026         # for that test eventlog needs to be empty
00027         nuke_eventlog(self.request)
00028         # hits is based on hitcounts which reads the cache
00029         caching.CacheEntry(request, 'charts', 'pagehits', scope='wiki').remove()
00030         caching.CacheEntry(request, 'charts', 'hitcounts', scope='wiki').remove()

Here is the call graph for this function:

Definition at line 31 of file test_PageHits.py.

00031 
00032     def teardown_class(self):
00033         nuke_page(self.request, self.pagename)

Here is the call graph for this function:

macro PageHits test: updating of cache from event-log for multiple call of PageHits

Definition at line 38 of file test_PageHits.py.

00038 
00039     def testPageHits(self):
00040         """ macro PageHits test: updating of cache from event-log for multiple call of PageHits"""
00041         count = 20
00042         for counter in range(count):
00043             eventlog.EventLog(self.request).add(self.request, 'VIEWPAGE', {'pagename': 'PageHits'})
00044             result = self._test_macro(u'PageHits', u'') # XXX SENSE???
00045         cache = caching.CacheEntry(self.request, 'charts', 'pagehits', scope='wiki', use_pickle=True)
00046         date, hits = 0, {}
00047         if cache.exists():
00048             try:
00049                 date, hits = cache.content()
00050             except caching.CacheError:
00051                 cache.remove()
00052         assert hits['PageHits'] == count

Here is the call graph for this function:


Member Data Documentation

Definition at line 24 of file test_PageHits.py.

string test_PageHits.TestHits.pagename = u'AutoCreatedMoinMoinTemporaryTestPageForPageHits' [static]

Definition at line 19 of file test_PageHits.py.


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