def tearDown(self):
        """ Called after each test. """
        self.client.quit()
        analysis_server.stop_server(self.server)
        os.remove('hosts.allow')

        for egg in glob.glob('*.egg'):
            os.remove(egg)
        for egg in glob.glob(os.path.join('OptComps', '*.egg')):
            os.remove(egg)

        for dirname in ('ASTestComp', 'ASTestComp2', 'logs'):
            if os.path.exists(dirname):
                try:
                    shutil.rmtree(dirname)
                except WindowsError as exc:
                    print 'rmtree failed:', exc
        try:
            os.remove('as-0.out')
        except WindowsError:
            pass  # Still in use by server...

        # Server enforces versioned config files.
        for cfg in ('RosenSuzuki', 'PrintEnv'):
            original = os.path.join('OptComps', '%s.cfg' % cfg)
            versioned = os.path.join('OptComps', '%s-0.1.cfg' % cfg)
            if os.path.exists(versioned):
                os.rename(versioned, original)

        os.chdir(ORIG_DIR)
Ejemplo n.º 2
0
    def tearDown(self):
        """ Called after each test. """
        self.factory.shutdown()
        analysis_server.stop_server(self.server)
        os.remove('hosts.allow')

        for egg in glob.glob('*.egg'):
            os.remove(egg)
        for egg in glob.glob(os.path.join('OptComps', '*.egg')):
            os.remove(egg)

        for dirname in ('ASTestComp', 'ASTestComp2', 'logs'):
            if os.path.exists(dirname):
                try:
                    shutil.rmtree(dirname)
                except WindowsError as exc:
                    print 'rmtree failed:', exc
        try:
            os.remove('as-0.out')
        except WindowsError:
            pass  # Still in use by server...

        # Server enforces versioned config files.
        for cfg in ('RosenSuzuki', 'PrintEnv'):
            original = os.path.join('OptComps', '%s.cfg' % cfg)
            versioned = os.path.join('OptComps', '%s-0.1.cfg' % cfg)
            if os.path.exists(versioned):
                os.rename(versioned, original)

        os.chdir(ORIG_DIR)
Ejemplo n.º 3
0
 def tearDown(self):
     """ Called after each test. """
     analysis_server.stop_server(self.server)
     os.remove('hosts.allow')
     for egg in glob.glob('*.egg'):
         os.remove(egg)
     for dirname in ('ASTestComp', 'ASTestComp2', 'logs'):
         if os.path.exists(dirname):
             shutil.rmtree(dirname)
     try:
         os.remove('as-0.out')
     except WindowsError:
         pass  # Still in use by server...
     os.chdir(ORIG_DIR)