root/ipython/branches/saw/sandbox/tconfig/tctst.py

Revision 2549, 0.8 kB (checked in by fperez, 3 years ago)

API cleanup and name changes.

Line 
1 """Little utilities for testing tconfig.
2
3 This module is meant to be used via
4
5 import tctst; reload(tctst)
6 from tctst import *
7
8 at the top of the actual test scripts, so that they all get the entire set of
9 common test tools with minimal fuss.
10 """
11
12 # Standard library imports
13 import os
14 import sys
15 from pprint import pprint
16
17 # Our own imports.
18
19 import tconfig
20 reload(tconfig)
21
22 from tconfig import mkConfigObj, RecursiveConfigObj, TConfigManager, \
23      tconf2File
24
25 # Simple utilities/classes for testing
26
27 def cat(fname):
28     print '### FILENAME:',fname
29     print open(fname).read()
30
31
32 class App(object):
33     """A trivial 'application' class to be initialized.
34     """
35     def __init__(self,configClass,configFilename):
36         self.rcman = TConfigManager(configClass,configFilename)
37         self.rc = self.rcman.tconf
Note: See TracBrowser for help on using the browser.