mirror of
https://github.com/iluvcapra/ptulsconv.git
synced 2025-12-31 08:50:48 +00:00
35 lines
914 B
Python
35 lines
914 B
Python
import unittest
|
|
|
|
import tempfile
|
|
|
|
import os.path
|
|
import os
|
|
import glob
|
|
|
|
from ptulsconv import commands
|
|
|
|
class TestBroadcastTimecode(unittest.TestCase):
|
|
def test_report_generation(self):
|
|
"""
|
|
Setp through every text file in export_cases and make sure it can
|
|
be converted into PDF docs without throwing an error
|
|
"""
|
|
files = [os.path.dirname(__file__) + "/../export_cases/Robin Hood Spotting.txt"]
|
|
#files.append(os.path.dirname(__file__) + "/../export_cases/Robin Hood Spotting2.txt")
|
|
for path in files:
|
|
tempdir = tempfile.TemporaryDirectory()
|
|
os.chdir(tempdir.name)
|
|
try:
|
|
commands.convert(path, major_mode='doc')
|
|
except:
|
|
assert False, "Error processing file %s" % path
|
|
finally:
|
|
tempdir.cleanup()
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|