Fix tests cleanup

This commit is contained in:
Augusto Gunsch 2021-11-15 18:24:50 -03:00
parent 45acfa2b1c
commit 1bdcc9f44e
No known key found for this signature in database
GPG Key ID: F7EEFE29825C72DC
1 changed files with 9 additions and 10 deletions

View File

@ -26,18 +26,17 @@ class TestFsub(unittest.TestCase):
limit = len(ofiles)
for i, ifile in enumerate(ifiles):
if i == limit:
break
out = open(ifile)
result = out.read()
out.close()
if i < limit:
out = open(ifile)
result = out.read()
out.close()
ofile = str(self.samples / ofiles[i]) + '.srt'
cmp_file = open(ofile)
cmp = cmp_file.read()
cmp_file.close()
ofile = str(self.samples / ofiles[i]) + '.srt'
cmp_file = open(ofile)
cmp = cmp_file.read()
cmp_file.close()
self.assertEqual(result, cmp)
self.assertEqual(result, cmp)
os.remove(ifile)
def test_cleaned(self):