- Timestamp:
- 3 Oct 2012, 21:36:14 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/tests/test_batching.py
r9271 r9283 94 94 clearSite() 95 95 shutil.rmtree(self.dc_root) 96 shutil.rmtree(self.workdir) 96 97 97 98 class ACBatchProcessorTest(ACFullSetup): … … 126 127 self.csv_file = os.path.join(self.workdir, 'sample_batch_data.csv') 127 128 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)) 129 132 130 133 self.processor = AccessCodeProcessor() … … 175 178 self.csv_file = os.path.join(self.workdir, 'sample_batch_data.csv') 176 179 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)) 178 183 179 184 self.processor = AccessCodeProcessor() … … 182 187 num, num_warns, fin_file, fail_file = self.processor.doImport( 183 188 self.csv_file, AC_HEADER_FIELDS) 189 shutil.rmtree(os.path.dirname(fin_file)) 184 190 185 191 self.assertEqual(self.app['accesscodes']['HOS-1'].used_num, 1) … … 192 198 num, num_warns, fin_file, fail_file = self.processor.doImport( 193 199 self.csv_file, AC_HEADER_FIELDS_UPDATE, 'update') 194 fin_file = open(fin_file).read()195 200 self.assertEqual(num_warns,0) 196 201 self.assertEqual( … … 216 221 self.assertEqual(self.app['accesscodes']['CLR-1'].used_num, 1) 217 222 self.assertEqual(self.app['accesscodes']['CLR-1'].disabled_num, 0) 223 shutil.rmtree(os.path.dirname(fin_file)) 218 224 return
Note: See TracChangeset for help on using the changeset viewer.