Skip to content
Snippets Groups Projects
Commit 4e308622 authored by RABijl's avatar RABijl
Browse files

adds parametrized test for pdf generation of checkboxes

parent 51c6228e
Branches mc-checkbox-exam-api
No related tags found
1 merge request!6Draw pdf box
Pipeline #17429 passed
......@@ -106,6 +106,18 @@ def test_generate_pdfs_num_files(datadir, tmpdir):
assert len(tmpdir.listdir()) == num_copies
def test_generate_checkboxes(datadir, tmpdir):
blank_pdf = os.path.join(datadir, 'blank-a4-2pages.pdf')
num_copies = 1
copy_nums = range(num_copies)
paths = map(lambda copy_num: os.path.join(tmpdir, f'{copy_num}.pdf'), copy_nums)
checkboxes = [(300, 100, 1, 'c'), (500, 50, 0, 'd'), (500, 500, 0, 'a'), (250, 200, 1, 'b')]
pdf_generation.generate_pdfs(blank_pdf, 'ABCDEFGHIJKL', copy_nums, paths, 25, 270, 150, 270, checkboxes)
assert len(tmpdir.listdir()) == num_copies
@pytest.mark.parametrize('name', ['a4', 'square'], ids=['a4', 'square'])
def test_join_pdfs(mock_generate_datamatrix, mock_generate_id_grid,
datadir, tmpdir, name):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment