Ignore:
Timestamp:
3 Oct 2012, 21:36:14 (12 years ago)
Author:
Henrik Bettermann
Message:

Remove temporary dirs in tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/tests/test_batching.py

    r9271 r9283  
    9494        clearSite()
    9595        shutil.rmtree(self.dc_root)
     96        shutil.rmtree(self.workdir)
    9697
    9798class ACBatchProcessorTest(ACFullSetup):
     
    126127        self.csv_file = os.path.join(self.workdir, 'sample_batch_data.csv')
    127128        open(self.csv_file, 'wb').write(BATCH_SAMPLE_DATA)
    128         self.processor.doImport(self.csv_file, BATCH_HEADER_FIELDS)
     129        num, num_warns, fin_file, fail_file =  self.processor.doImport(
     130            self.csv_file, BATCH_HEADER_FIELDS)
     131        shutil.rmtree(os.path.dirname(fin_file))
    129132
    130133        self.processor = AccessCodeProcessor()
     
    175178        self.csv_file = os.path.join(self.workdir, 'sample_batch_data.csv')
    176179        open(self.csv_file, 'wb').write(BATCH_SAMPLE_DATA)
    177         self.processor.doImport(self.csv_file, BATCH_HEADER_FIELDS)
     180        num, num_warns, fin_file, fail_file =  self.processor.doImport(
     181            self.csv_file, BATCH_HEADER_FIELDS)
     182        shutil.rmtree(os.path.dirname(fin_file))
    178183
    179184        self.processor = AccessCodeProcessor()
     
    182187        num, num_warns, fin_file, fail_file =  self.processor.doImport(
    183188            self.csv_file, AC_HEADER_FIELDS)
     189        shutil.rmtree(os.path.dirname(fin_file))
    184190
    185191        self.assertEqual(self.app['accesscodes']['HOS-1'].used_num, 1)
     
    192198        num, num_warns, fin_file, fail_file =  self.processor.doImport(
    193199            self.csv_file, AC_HEADER_FIELDS_UPDATE, 'update')
    194         fin_file = open(fin_file).read()
    195200        self.assertEqual(num_warns,0)
    196201        self.assertEqual(
     
    216221        self.assertEqual(self.app['accesscodes']['CLR-1'].used_num, 1)
    217222        self.assertEqual(self.app['accesscodes']['CLR-1'].disabled_num, 0)
     223        shutil.rmtree(os.path.dirname(fin_file))
    218224        return
Note: See TracChangeset for help on using the changeset viewer.