Changeset 8725 for main/waeup.kofa/trunk/src/waeup/kofa
- Timestamp:
- 14 Jun 2012, 16:47:57 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/datacenter.py
r8634 r8725 224 224 for name in os.listdir(os.path.join(self.storage, 'logs')): 225 225 if RE_LOGFILE_BACKUP_NAME.match(name): 226 files.append(name) 226 if name.rsplit('.', 1)[0] == basename: 227 files.append(name) 227 228 return sorted(files, key=numerical_suffix, reverse=True) 228 229 -
main/waeup.kofa/trunk/src/waeup/kofa/tests/test_datacenter.py
r8634 r8725 12 12 from waeup.kofa.interfaces import IDataCenter, IDataCenterConfig 13 13 14 15 14 class DataCenterLogQueryTests(unittest.TestCase): 16 15 # Tests for querying logfiles via datacenter. … … 37 36 path = self.logpath 38 37 for m in range(num-1,-1,-1): 38 # write messages in order: lowest message in oldest file 39 39 fp = open(path, 'wb') 40 40 for n in range(50*m, 50*m+50): … … 42 42 fp.write('Other Line %d\n' % (n + 1)) 43 43 fp.close() 44 path = self.logpath + '.%d' % (m + 1)44 path = self.logpath + '.%d' % m 45 45 return 46 46 … … 75 75 open(self.logpath, 'wb').write('Msg 1\n') 76 76 open(self.logpath + '-not-a-real-log', 'wb').write('Msg 2\n') 77 open(self.logpath + '-not-a-real-log.1', 'wb').write('Msg 3\n') 77 78 result = list(datacenter.queryLogfiles('myapp.log', 'Msg')) 78 # Msg 2 won't show up in results.79 # Msg 2 and 3 won't show up in results. 79 80 self.assertEqual(result, ['Msg 1\n']) 80 81 return … … 226 227 # The source is deleted afterwards 227 228 self.assertEqual(os.path.exists(csv_file2), False) 229 return 228 230 229 231 def test_append_csv_file_no_dest(self): … … 240 242 # The source is deleted afterwards 241 243 self.assertEqual(os.path.exists(csv_file2), False) 244 return 242 245 243 246 def test_append_csv_file_no_source(self): … … 252 255 # csv_file1 is the same as before 253 256 self.assertEqual(result, 'name,age\nManfred,28\n') 257 return 254 258 255 259 def test_append_csv_file_same_src_and_dest(self): … … 265 269 self.assertEqual(result, 'name,age\nManfred,28\n') 266 270 self.assertEqual(os.path.exists(csv_file2), True) 271 return
Note: See TracChangeset for help on using the changeset viewer.