[tests] added test for not deleting the file if the same file is processed

This commit is contained in:
Pierre Mdawar 2019-01-03 16:16:17 +02:00
parent b3152c00d6
commit 61fcc9b7eb

View File

@ -627,6 +627,16 @@ class TestYoutubeDL(unittest.TestCase):
self.assertTrue(os.path.exists(audiofile), '%s doesn\'t exist' % audiofile)
os.unlink(audiofile)
class SameFilePP(PostProcessor):
def run(self, info):
with open(info['filepath'], 'wt') as f:
f.write('EXAMPLE')
return [info['filepath']], info
run_pp({'keepvideo': False}, SameFilePP)
self.assertTrue(os.path.exists(filename), '%s doesn\'t exist' % filename)
os.unlink(filename)
class ModifierPP(PostProcessor):
def run(self, info):
with open(info['filepath'], 'wt') as f: