Changeset 154

Show
Ignore:
Timestamp:
05/02/07 14:38:41 (2 years ago)
Author:
rgrp
Message:

Add support for providing path to config file on the command line to domainmode-test script.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/bin/domainmodel-test

    r125 r154  
    1212os.environ['DJANGO_SETTINGS_MODULE'] = 'dm.django.settings.main' 
    1313 
    14 from dm.testunit import ApplicationTestSuite 
    15 ApplicationTestSuite.buildApplication() 
    16  
    1714if __name__ == "__main__": 
    1815    usage  = 'usage: %prog [options] [module_name]' 
     
    2623        action='store', type='int', dest='level', default=1, 
    2724        help='Verbosity level of test runner') 
     25    parser.add_option('-c', '--conf', 
     26        action='store', type='str', dest='config', default='', 
     27        help='Path to configuration file. If not provided please ensure ' + \ 
     28          'relevant environment variable is set.' 
     29        ) 
    2830     
     31    (options, args) = parser.parse_args() 
     32    if options.config: 
     33        os.environ['DOMAINMODEL_SETTINGS'] = options.config 
     34     
     35    # import after SETTINGS is set 
     36    from dm.testunit import ApplicationTestSuite 
     37    ApplicationTestSuite.buildApplication() 
     38 
    2939    (options, args) = parser.parse_args() 
    3040    # by default always 1 argument (name of file itself)