changeset 2314:38b6ba04671b

Fix issues pointed out by xorAxAx.
author Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
date Fri, 22 Jun 2007 18:54:13 +0200
parents a85d51778eda
children 69ed234c3241
files MoinMoin/_tests/test_events.py MoinMoin/_tests/test_xmlrpc_multicall.py
diffstat 2 files changed, 12 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/test_events.py	Fri Jun 22 17:58:23 2007 +0200
+++ b/MoinMoin/_tests/test_events.py	Fri Jun 22 18:54:13 2007 +0200
@@ -9,13 +9,12 @@
 from MoinMoin.request.CLI import Request
 import MoinMoin.events as events
 
-def test_get_handlers():
+def test_get_handlers(request):
     """Test if there are any event handlers. There should be some internal ones"""
     
-    request = Request()
-    assert(events.get_handlers(request.cfg))
+    assert events.get_handlers(request.cfg)
 
-def test_send_event():
+def test_send_event(request):
     """Test if event handlers are called and if proper messages are returned"""
     
     return_string = u"test_send_event"
@@ -23,15 +22,16 @@
     def event_handler(event):
         return return_string
     
-    request = Request()
     request.cfg.event_handlers = [event_handler]
     event = events.Event(request)
     
     print "A proper event handler should be called, and an 1-element list of messages returned"
-    assert(events.send_event(event)[0] == return_string)
+    assert events.send_event(event)[0] == return_string
 
-def test_subscribable_events():
+def test_subscribable_events(request):
     """Test if there are any subscribable events. There should be some."""
     
     print "There should be at least a few subscribable events!"
-    assert(events.get_subscribable_events())
+    assert events.get_subscribable_events()
+    
+coverage_modules = ["MoinMoin.events"]
--- a/MoinMoin/_tests/test_xmlrpc_multicall.py	Fri Jun 22 17:58:23 2007 +0200
+++ b/MoinMoin/_tests/test_xmlrpc_multicall.py	Fri Jun 22 18:54:13 2007 +0200
@@ -7,14 +7,13 @@
 """
 
 from MoinMoin.xmlrpc import XmlRpcBase
-from MoinMoin.request.CLI import Request
 from xmlrpclib import Fault
 
 def xmlrpc_return_fault():
     return Fault(666, "Fault description")
 
-def test_fault_serialization():
-    xmlrpc = XmlRpcBase(Request())
+def test_fault_serialization(request):
+    xmlrpc = XmlRpcBase(request)
     xmlrpc.xmlrpc_return_fault = xmlrpc_return_fault
     args = [{'methodName': 'return_fault', 'params': [ ]}]
     
@@ -23,6 +22,5 @@
     8b7d6d70fc95 for details"""
     
     result = xmlrpc.xmlrpc_system_multicall(args)
-    assert(type(result[0]) == dict)
-    assert(result[0].has_key("faultCode") and result[0].has_key("faultString"))
-    
\ No newline at end of file
+    assert type(result[0]) == dict
+    assert result[0].has_key("faultCode") and result[0].has_key("faultString")