mirror of
https://github.com/iluvcapra/ptulsconv.git
synced 2025-12-31 08:50:48 +00:00
Rewrote parsing to handle old & new-style markers
This commit is contained in:
@@ -6,7 +6,6 @@ import sys
|
||||
import os.path
|
||||
import os
|
||||
import glob
|
||||
|
||||
from ptulsconv import commands
|
||||
|
||||
class TestPDFExport(unittest.TestCase):
|
||||
@@ -15,24 +14,39 @@ class TestPDFExport(unittest.TestCase):
|
||||
Setp through every text file in export_cases and make sure it can
|
||||
be converted into PDF docs without throwing an error
|
||||
"""
|
||||
files = []
|
||||
files = [os.path.dirname(__file__) + "/../export_cases/Robin Hood Spotting.txt"]
|
||||
for path in files:
|
||||
tempdir = tempfile.TemporaryDirectory()
|
||||
os.chdir(tempdir.name)
|
||||
try:
|
||||
commands.convert(input_file=path, major_mode='doc')
|
||||
except Exception as e:
|
||||
print("Error in test_report_generation")
|
||||
print(f"File: {path}")
|
||||
print(repr(e))
|
||||
raise e
|
||||
finally:
|
||||
tempdir.cleanup()
|
||||
|
||||
def test_report_generation_track_markers(self):
|
||||
files = []
|
||||
files.append(os.path.dirname(__file__) + "/../export_cases/Test for ptulsconv.txt")
|
||||
for path in files:
|
||||
tempdir = tempfile.TemporaryDirectory()
|
||||
os.chdir(tempdir.name)
|
||||
try:
|
||||
commands.convert(input_file=path, major_mode='doc')
|
||||
except:
|
||||
print("Error in test_report_generation")
|
||||
except Exception as e:
|
||||
print("Error in test_report_generation_track_markers")
|
||||
print(f"File: {path}")
|
||||
print(repr(sys.exception()))
|
||||
raise sys.exception()
|
||||
print(repr(e))
|
||||
raise e
|
||||
finally:
|
||||
tempdir.cleanup()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user