def tearDown(self): fm = FileManager() iq = ImportQueue() if os.path.isdir (fm.build_buffer_path(self.now)): shutil.rmtree(fm.build_buffer_path(self.now)) if os.path.isdir (iq.build_data_path(self.now)): shutil.rmtree(iq.build_data_path(self.now))
def test_save_post_file_ok(self): fm = FileManager(self.dir) fm.save_post_file(self.post_data) self.assertTrue(os.path.isfile(os.path.join(fm.build_buffer_path(self.now), self.filename))) os.unlink(os.path.join(fm.build_buffer_path(self.now), self.filename))
def tearDown(self): fm = FileManager(self.dir) os.rmdir(fm.build_buffer_path(self.now)) os.rmdir(self.dir)