source: TI12-security/trunk/python/Tests/LogTest.py @ 1636

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/Tests/LogTest.py@2539
Revision 1636, 1.4 KB checked in by pjkersha, 13 years ago (diff)

Change to new package structure. All refs to NDG package changed to ndg.security

Line 
1#!/usr/bin/env python
2"""NDG Logging class test harness
3
4NERC Data Grid Project
5
6P J Kershaw 12/05/06
7
8Copyright (C) 2006 CCLRC & NERC
9
10This software may be distributed under the terms of the Q Public License,
11version 1.0 or later.
12"""
13import unittest
14
15from ndg.security.Log import *
16
17class LogTestCase(unittest.TestCase):
18
19    def setUp(self):
20        self.log = Log(logFilePath="./ndg.log", console=True)
21
22    def test(self):
23       
24        # Now, we can log to the root logger, or any other logger. First the root...
25        try:
26            self.log.info('Jackdaws love my big sphinx of quartz.')
27       
28            self.log.debug('Quick zephyrs blow, vexing daft Jim.')
29            self.log.info('How quickly daft jumping zebras vex.')
30            self.log.warning('Jail zesty vixen who grabbed pay from quack.')
31            self.log.error('The five boxing wizards jump quickly.')
32           
33        except Exception, e:
34            self.fail(str(e))
35           
36           
37#_____________________________________________________________________________       
38class LogTestSuite(unittest.TestSuite):
39   
40    def __init__(self):
41        map = map(LogTestCase,
42                  (
43                    "test",
44                  ))
45        unittest.TestSuite.__init__(self, map)
46           
47                                                   
48if __name__ == "__main__":
49    unittest.main()
Note: See TracBrowser for help on using the repository browser.