Commit 41c22a29 authored by Christian Rohlfing's avatar Christian Rohlfing
Browse files

Fixed test_supplements

parent 2eeba13f
......@@ -18,16 +18,19 @@ class MainTest(unittest.TestCase):
def test_supplements_from_pdf_folder(self):
import supplements
expected_files = ['123456_Nachname_GDET3_20H.pdf',
'123456_Nachname_GDET3_20H_loes.pdf',
'456789_Lastname_GDET3_20H.pdf',
'456789_Lastname_GDET3_20H_loes.pdf',
'567891_Student_GDET3_20H.pdf',
'567891_Student_GDET3_20H_loes.pdf']
expected_files = [
'123001_LastnameA_GDET3_20H.pdf',
'123001_LastnameA_GDET3_20H_loes.pdf',
'123002_LastnameB_GDET3_20H.pdf',
'123002_LastnameB_GDET3_20H_loes.pdf',
'123010_LastnameJ_GDET3_20H.pdf',
'123010_LastnameJ_GDET3_20H_loes.pdf',
'123011_LastnameK_GDET3_20H.pdf',
'123011_LastnameK_GDET3_20H_loes.pdf']
# Prepare parameter
supp_dir = './supplements'
pdf_dir = './pdfs'
supp_dir = './tests/assets/supplements'
pdf_dir = './tests/assets/pdfs'
supp_out_dir = os.path.join(self.test_dir, 'supplements_out')
os.mkdir(supp_out_dir)
......@@ -46,16 +49,21 @@ class MainTest(unittest.TestCase):
def test_supplements_from_csv(self):
import supplements
expected_files = ['123456_F_GDET3_20H.pdf',
'123456_F_GDET3_20H_loes.pdf',
'123457_O_GDET3_20H.pdf',
'123457_O_GDET3_20H_loes.pdf',
'125412_T_GDET3_20H.pdf',
'125412_T_GDET3_20H_loes.pdf']
expected_files = [
'123001_L_GDET3_20H.pdf',
'123001_L_GDET3_20H_loes.pdf',
'123002_L_GDET3_20H.pdf',
'123002_L_GDET3_20H_loes.pdf',
'123010_L_GDET3_20H.pdf',
'123010_L_GDET3_20H_loes.pdf',
'123011_L_GDET3_20H.pdf',
'123011_L_GDET3_20H_loes.pdf',
'123012_d_GDET3_20H.pdf',
'123012_d_GDET3_20H_loes.pdf']
# Prepare parameter
supp_dir = './supplements'
csv = 'Bewertungen.csv'
supp_dir = './tests/assets/supplements'
csv = './tests/assets/Grades.csv'
supp_out_dir = os.path.join(self.test_dir, 'supplements_out')
os.mkdir(supp_out_dir)
......@@ -75,16 +83,19 @@ class MainTest(unittest.TestCase):
import supplements
import watermark
expected_files = ['123456_Nachname_GDET3_20H_loes_w.pdf',
'123456_Nachname_GDET3_20H_w.pdf',
'456789_Lastname_GDET3_20H_loes_w.pdf',
'456789_Lastname_GDET3_20H_w.pdf',
'567891_Student_GDET3_20H_loes_w.pdf',
'567891_Student_GDET3_20H_w.pdf']
expected_files = [
'123001_LastnameA_GDET3_20H_loes_w.pdf',
'123001_LastnameA_GDET3_20H_w.pdf',
'123002_LastnameB_GDET3_20H_loes_w.pdf',
'123002_LastnameB_GDET3_20H_w.pdf',
'123010_LastnameJ_GDET3_20H_loes_w.pdf',
'123010_LastnameJ_GDET3_20H_w.pdf',
'123011_LastnameK_GDET3_20H_loes_w.pdf',
'123011_LastnameK_GDET3_20H_w.pdf']
# Prepare parameter
supp_dir = './supplements'
pdf_dir = './pdfs'
supp_dir = './tests/assets/supplements'
pdf_dir = './tests/assets/pdfs'
dpi = 100
supp_out_dir = os.path.join(self.test_dir, 'supplements_out')
......@@ -97,11 +108,12 @@ class MainTest(unittest.TestCase):
os.mkdir(out_dir)
# Copy supplements file
supplements.main(["-i", supp_dir, "-p", pdf_dir, "-o", supp_out_dir])
supplements.main(
["-i", supp_dir, "-p", pdf_dir, "-o", supp_out_dir])
# Watermark files
watermark.main(["-i", supp_out_dir, "-o", out_dir,
"-t", tmp_dir, "--dpi", str(dpi)])
watermark.main(
[supp_out_dir, out_dir, "-t", tmp_dir, "--dpi", str(dpi)])
# Assert output
created_files = os.listdir(out_dir)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment