changeset 3948:62b9f61eb526

macro._tests: whitespace removed, docstring adjusted
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sat, 16 Aug 2008 10:37:40 +0200
parents 7626f4760d9f
children db5023512482
files MoinMoin/_tests/__init__.py MoinMoin/macro/_tests/test_Action.py MoinMoin/macro/_tests/test_EmbedObject.py MoinMoin/macro/_tests/test_FootNote.py MoinMoin/macro/_tests/test_GetVal.py MoinMoin/macro/_tests/test_Hits.py MoinMoin/macro/_tests/test_PageHits.py MoinMoin/macro/_tests/test_StatsChart.py MoinMoin/macro/_tests/test_macro.py
diffstat 9 files changed, 4 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/__init__.py	Sat Aug 16 10:18:23 2008 +0200
+++ b/MoinMoin/_tests/__init__.py	Sat Aug 16 10:37:40 2008 +0200
@@ -3,11 +3,12 @@
     MoinMoin - some common code for testing
 
     @copyright: 2007 MoinMoin:KarolNowak,
-                2008 MoinMoin:ThomasWaldmann
+                2008 MoinMoin:ThomasWaldmann, MoinMoin:ReimarBauer
     @license: GNU GPL, see COPYING for details.
 """
 
 import os, shutil
+
 from MoinMoin.parser.text import Parser
 from MoinMoin.formatter.text_html import Formatter
 from MoinMoin.Page import Page
@@ -114,5 +115,3 @@
     p.form = request.form
     m = macro.Macro(p)
     return m
-
-
--- a/MoinMoin/macro/_tests/test_Action.py	Sat Aug 16 10:18:23 2008 +0200
+++ b/MoinMoin/macro/_tests/test_Action.py	Sat Aug 16 10:37:40 2008 +0200
@@ -3,10 +3,10 @@
     MoinMoin - MoinMoin.macro.Action Tests
 
     @copyright: 2007 MoinMoin:ReimarBauer
-
     @license: GNU GPL, see COPYING for details.
 """
 import os
+
 from MoinMoin import macro
 from MoinMoin.macro import Action
 from MoinMoin.Page import Page
@@ -22,15 +22,12 @@
         """ module_tested: executes raw by macro Action on existing page"""
         request = self.request
         become_trusted(request)
-
         self.page = create_page(request, self.pagename, u'= title1 =\n||A||B||\n')
         m = make_macro(self.request, self.page)
         result = Action.macro_Action(m, 'raw')
         nuke_page(request, self.pagename)
-
         expected = '<a href="./AutoCreatedMoinMoinTemporaryTestPageForAction?action=raw">raw</a>'
         assert result == expected
 
-
 coverage_modules = ['MoinMoin.macro.Action']
 
--- a/MoinMoin/macro/_tests/test_EmbedObject.py	Sat Aug 16 10:18:23 2008 +0200
+++ b/MoinMoin/macro/_tests/test_EmbedObject.py	Sat Aug 16 10:37:40 2008 +0200
@@ -4,10 +4,8 @@
 
     @copyright: 2008 MoinMoin:ReimarBauer,
                 2008 MoinMoin:JohannesBerg
-
     @license: GNU GPL, see COPYING for details.
 """
-
 import py
 
 from MoinMoin import macro
@@ -22,10 +20,8 @@
     def setup_class(self):
         request = self.request
         pagename = self.pagename
-
         become_trusted(request)
         self.page = create_page(request, pagename, u"Foo")
-
         AttachFile.getAttachDir(request, pagename)
         test_files = [
             ('test.ogg', 'vorbis'),
--- a/MoinMoin/macro/_tests/test_FootNote.py	Sat Aug 16 10:18:23 2008 +0200
+++ b/MoinMoin/macro/_tests/test_FootNote.py	Sat Aug 16 10:37:40 2008 +0200
@@ -3,15 +3,14 @@
     MoinMoin - MoinMoin.macro.FootNote Tests
 
     @copyright: 2008 MoinMoin:ReimarBauer
-
     @license: GNU GPL, see COPYING for details.
 """
 import os
+
 from MoinMoin import macro
 from MoinMoin.macro import FootNote
 from MoinMoin.Page import Page
 from MoinMoin.PageEditor import PageEditor
-
 from MoinMoin._tests import become_trusted, create_page, make_macro, nuke_page
 
 class TestFootNote:
@@ -33,8 +32,6 @@
         text = 'b'
         FootNote.execute(m, text)
         result = FootNote.emit_footnotes(m.request, m.request.formatter)
-
         assert result.endswith('2</a>)</li></ol></div>')
 
-
 coverage_modules = ['MoinMoin.macro.FootNote']
--- a/MoinMoin/macro/_tests/test_GetVal.py	Sat Aug 16 10:18:23 2008 +0200
+++ b/MoinMoin/macro/_tests/test_GetVal.py	Sat Aug 16 10:37:40 2008 +0200
@@ -3,7 +3,6 @@
     MoinMoin - MoinMoin.macro GetVal tested
 
     @copyright: 2007 MoinMoin:ReimarBauer
-
     @license: GNU GPL, see COPYING for details.
 """
 import os, py
@@ -11,7 +10,6 @@
 from MoinMoin import macro
 from MoinMoin.Page import Page
 from MoinMoin.PageEditor import PageEditor
-
 from MoinMoin._tests import become_trusted, create_page, make_macro, nuke_page
 
 class TestGetVal:
--- a/MoinMoin/macro/_tests/test_Hits.py	Sat Aug 16 10:18:23 2008 +0200
+++ b/MoinMoin/macro/_tests/test_Hits.py	Sat Aug 16 10:37:40 2008 +0200
@@ -11,7 +11,6 @@
 from MoinMoin.logfile import eventlog
 from MoinMoin.PageEditor import PageEditor
 from MoinMoin.Page import Page
-
 from MoinMoin._tests import become_trusted, create_page, make_macro, nuke_eventlog, nuke_page
 
 class TestHits:
@@ -22,10 +21,8 @@
         request = self.request
         become_trusted(request)
         self.page = create_page(request, self.pagename, u"Foo!")
-
         # for that test eventlog needs to be empty
         nuke_eventlog(request)
-
         # hits is based on hitcounts which reads the cache
         caching.CacheEntry(request, 'charts', 'hitcounts', scope='wiki').remove()
 
@@ -51,7 +48,6 @@
         eventlog.EventLog(self.request).add(self.request, 'VIEWPAGE', {'pagename': 'WikiSandBox'})
         for i in range(count):
             eventlog.EventLog(self.request).add(self.request, 'VIEWPAGE', {'pagename': self.pagename})
-
         result = self._test_macro(u'Hits', u'')
         self._cleanStats()
         assert result == str(count)
@@ -65,7 +61,6 @@
         for i in range(count):
             for pagename in pagenames:
                 eventlog.EventLog(self.request).add(self.request, 'VIEWPAGE', {'pagename': pagename})
-
         result = self._test_macro(u'Hits', u'all=True')
         self._cleanStats()
         assert result == str(count * num_pages)
@@ -75,7 +70,6 @@
         eventlog.EventLog(self.request).add(self.request, 'SAVEPAGE', {'pagename': self.pagename})
         # simulate a log entry SAVEPAGE for WikiSandBox to destinguish current page
         eventlog.EventLog(self.request).add(self.request, 'SAVEPAGE', {'pagename': 'WikiSandBox'})
-
         result = self._test_macro(u'Hits', u'event_type=SAVEPAGE')
         self._cleanStats()
         assert result == "1"
@@ -84,7 +78,6 @@
         """ macro test: 'all=True, event_type=SAVEPAGE' for Hits (all pages are counted for SAVEPAGE)"""
         eventlog.EventLog(self.request).add(self.request, 'SAVEPAGE', {'pagename': 'WikiSandBox'})
         eventlog.EventLog(self.request).add(self.request, 'SAVEPAGE', {'pagename': self.pagename})
-
         result = self._test_macro(u'Hits', u'all=True, event_type=SAVEPAGE')
         self._cleanStats()
         assert result == "2"
--- a/MoinMoin/macro/_tests/test_PageHits.py	Sat Aug 16 10:18:23 2008 +0200
+++ b/MoinMoin/macro/_tests/test_PageHits.py	Sat Aug 16 10:37:40 2008 +0200
@@ -3,7 +3,6 @@
     MoinMoin - MoinMoin.macro PageHits tested
 
     @copyright: 2008 MoinMoin:ReimarBauer
-
     @license: GNU GPL, see COPYING for details.
 """
 import os
@@ -23,10 +22,8 @@
         request = self.request
         become_trusted(request)
         self.page = create_page(request, self.pagename, u"Foo!")
-
         # for that test eventlog needs to be empty
         nuke_eventlog(self.request)
-
         # hits is based on hitcounts which reads the cache
         caching.CacheEntry(request, 'charts', 'pagehits', scope='wiki').remove()
         caching.CacheEntry(request, 'charts', 'hitcounts', scope='wiki').remove()
@@ -44,7 +41,6 @@
         for counter in range(count):
             eventlog.EventLog(self.request).add(self.request, 'VIEWPAGE', {'pagename': 'PageHits'})
             result = self._test_macro(u'PageHits', u'') # XXX SENSE???
-
         cache = caching.CacheEntry(self.request, 'charts', 'pagehits', scope='wiki', use_pickle=True)
         date, hits = 0, {}
         if cache.exists():
--- a/MoinMoin/macro/_tests/test_StatsChart.py	Sat Aug 16 10:18:23 2008 +0200
+++ b/MoinMoin/macro/_tests/test_StatsChart.py	Sat Aug 16 10:37:40 2008 +0200
@@ -3,7 +3,6 @@
     MoinMoin - MoinMoin.macro StatsChart tested
 
     @copyright: 2008 MoinMoin:ReimarBauer
-
     @license: GNU GPL, see COPYING for details.
 """
 import os
--- a/MoinMoin/macro/_tests/test_macro.py	Sat Aug 16 10:18:23 2008 +0200
+++ b/MoinMoin/macro/_tests/test_macro.py	Sat Aug 16 10:37:40 2008 +0200
@@ -30,6 +30,5 @@
         result = m.execute("BR", "")
         assert result == expected
 
-
 coverage_modules = ['MoinMoin.macro']