[tests] added test for not deleting the file if the same file is processed
This commit is contained in:
parent
b3152c00d6
commit
61fcc9b7eb
@ -627,6 +627,16 @@ class TestYoutubeDL(unittest.TestCase):
|
|||||||
self.assertTrue(os.path.exists(audiofile), '%s doesn\'t exist' % audiofile)
|
self.assertTrue(os.path.exists(audiofile), '%s doesn\'t exist' % audiofile)
|
||||||
os.unlink(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):
|
class ModifierPP(PostProcessor):
|
||||||
def run(self, info):
|
def run(self, info):
|
||||||
with open(info['filepath'], 'wt') as f:
|
with open(info['filepath'], 'wt') as f:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user