comparison test/db_test_base.py @ 4786:6018617c55ab

Removing remains of "rlog" module, fixes db unit test debug logging via environment variable.
author Bernhard Reiter <bernhard@intevation.de>
date Sun, 05 May 2013 00:21:27 +0200
parents 4960a2c21590
children 4a017661e414
comparison
equal deleted inserted replaced
4785:81ab5ffa6863 4786:6018617c55ab
14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17 17
18 import unittest, os, shutil, errno, imp, sys, time, pprint, base64, os.path 18 import unittest, os, shutil, errno, imp, sys, time, pprint, base64, os.path
19 import logging
19 import gpgmelib 20 import gpgmelib
20 from email.parser import FeedParser 21 from email.parser import FeedParser
21 22
22 from roundup.hyperdb import String, Password, Link, Multilink, Date, \ 23 from roundup.hyperdb import String, Password, Link, Multilink, Date, \
23 Interval, DatabaseError, Boolean, Number, Node 24 Interval, DatabaseError, Boolean, Number, Node
32 config.RDBMS_NAME = "rounduptest" 33 config.RDBMS_NAME = "rounduptest"
33 config.RDBMS_HOST = "localhost" 34 config.RDBMS_HOST = "localhost"
34 config.RDBMS_USER = "rounduptest" 35 config.RDBMS_USER = "rounduptest"
35 config.RDBMS_PASSWORD = "rounduptest" 36 config.RDBMS_PASSWORD = "rounduptest"
36 config.RDBMS_TEMPLATE = "template0" 37 config.RDBMS_TEMPLATE = "template0"
37 #config.logging = MockNull()
38 # these TRACKER_WEB and MAIL_DOMAIN values are used in mailgw tests 38 # these TRACKER_WEB and MAIL_DOMAIN values are used in mailgw tests
39 config.MAIL_DOMAIN = "your.tracker.email.domain.example" 39 config.MAIL_DOMAIN = "your.tracker.email.domain.example"
40 config.TRACKER_WEB = "http://tracker.example/cgi-bin/roundup.cgi/bugs/" 40 config.TRACKER_WEB = "http://tracker.example/cgi-bin/roundup.cgi/bugs/"
41 # uncomment the following to have excessive debug output from test cases 41 # uncomment the following to have excessive debug output from test cases
42 # FIXME: tracker logging level should be increased by -v arguments 42 # FIXME: tracker logging level should be increased by -v arguments
126 def open_database(self): 126 def open_database(self):
127 self.db = self.module.Database(config, 'admin') 127 self.db = self.module.Database(config, 'admin')
128 128
129 129
130 if os.environ.has_key('LOGGING_LEVEL'): 130 if os.environ.has_key('LOGGING_LEVEL'):
131 from roundup import rlog 131 logger = logging.getLogger('roundup.hyperdb')
132 config.logging = rlog.BasicLogging() 132 logger.setLevel(os.environ['LOGGING_LEVEL'])
133 config.logging.setLevel(os.environ['LOGGING_LEVEL'])
134 config.logging.getLogger('roundup.hyperdb').setFormat('%(message)s')
135 133
136 class commonDBTest(MyTestCase): 134 class commonDBTest(MyTestCase):
137 def setUp(self): 135 def setUp(self):
138 # remove previous test, ignore errors 136 # remove previous test, ignore errors
139 if os.path.exists(config.DATABASE): 137 if os.path.exists(config.DATABASE):

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