Ignore:
Timestamp:
08/12/06 14:23:51 (14 years ago)
Author:
spascoe
Message:

Moved test_home creation code into the package so that it can be run when
deployed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI03-DataExtractor/branches/repackaging/server/setup.py

    r1843 r1845  
    3131    def run(self): 
    3232        import os, pkg_resources, shutil, ConfigParser 
     33        from ndg.dx.server.MakeConfig import makeTestHome 
    3334 
    3435        # Wipe clean self.test_home 
     
    3637            shutil.rmtree(self.test_home) 
    3738        os.mkdir(self.test_home) 
    38         # Set NDG_HOME to be picked up by ndg.utils.config 
    39         os.environ['NDG_HOME'] = self.test_home 
    4039 
    41         # At this point it is safe to import the configuration. 
    42         # get global configuration (this will read /etc/ndg.conf) 
    43         from ndg.utils.config import config 
    44         from ndg.dx.server.MakeConfig import makeConfig 
    45  
    46         # parse selected test_conf 
    47         if self.test_conf: 
    48             config.read(self.test_conf) 
    49         else: 
    50             fp = pkg_resources.resource_stream('ndg.dx.server.test', 'server.conf') 
    51             config.readfp(fp) 
    52              
    53         # Set BASEDIR and create the dxs directory 
    54         config.set('ndg.dx.server', 'basedir', os.path.join(self.test_home, 'dxs')) 
    55         makeConfig() 
     40        makeTestHome(self.test_home, self.test_conf) 
    5641 
    5742        # Run the tests 
Note: See TracChangeset for help on using the changeset viewer.