comparison test/test_actions.py @ 2514:091711fb2f8c

Initial logging integration: replace all debug prints with logging calls... ...clean up and replace some with info() logs.
author Richard Jones <richard@users.sourceforge.net>
date Fri, 02 Jul 2004 05:22:09 +0000
parents cd5dcc39193d
children f8dafdd91bf5
comparison
equal deleted inserted replaced
2512:f5542d92307a 2514:091711fb2f8c
6 from roundup import hyperdb 6 from roundup import hyperdb
7 from roundup.date import Date, Interval 7 from roundup.date import Date, Interval
8 from roundup.cgi.actions import * 8 from roundup.cgi.actions import *
9 from roundup.cgi.exceptions import Redirect, Unauthorised, SeriousError 9 from roundup.cgi.exceptions import Redirect, Unauthorised, SeriousError
10 10
11 class MockNull: 11 from mocknull import MockNull
12 def __init__(self, **kwargs):
13 for key, value in kwargs.items():
14 self.__dict__[key] = value
15
16 def __call__(self, *args, **kwargs): return MockNull()
17 def __getattr__(self, name):
18 # This allows assignments which assume all intermediate steps are Null
19 # objects if they don't exist yet.
20 #
21 # For example (with just 'client' defined):
22 #
23 # client.db.config.TRACKER_WEB = 'BASE/'
24 self.__dict__[name] = MockNull()
25 return getattr(self, name)
26
27 def __getitem__(self, key): return self
28 def __nonzero__(self): return 0
29 def __str__(self): return ''
30 def __repr__(self): return '<MockNull 0x%x>'%id(self)
31 12
32 def true(*args, **kwargs): 13 def true(*args, **kwargs):
33 return 1 14 return 1
34 15
35 class ActionTestCase(unittest.TestCase): 16 class ActionTestCase(unittest.TestCase):

Roundup Issue Tracker: http://roundup-tracker.org/