def runForQt(self): ''' 执行qt 统计任务 :return: ''' audio_dir = ConfUtil.getQTAudioDir() image_dir = ConfUtil.getQTImageDir() res = defaultdict() res['totalAudioSize(bytes)'] = getDirSize(audio_dir) res['totalImageSize(bytes)'] = getDirSize(image_dir) res['totalAlbumCount'] = self.qtSt.getAlbumCount() res['totalAudioCount'] = self.qtSt.getAudioCount() res['audioCountPerCategory'] = self.qtSt.getAudioCountPerCategory() res['albumCountPerCategory'] = self.qtSt.getAlbumCountPerCategory() return res
def testConfUtil(self): self.assertEqual(ConfUtil.getQTAudioDir(),'/var/crawler/qt/audios/full') self.assertEqual( ConfUtil.getKLAudioDir(),'/var/crawler/kl/audios/full' )