Skip to content
Snippets Groups Projects
Commit 88fba756 authored by RABijl's avatar RABijl
Browse files

actually adds parameterized test

parent 4e308622
No related branches found
No related tags found
1 merge request!6Draw pdf box
......@@ -105,14 +105,15 @@ def test_generate_pdfs_num_files(datadir, tmpdir):
assert len(tmpdir.listdir()) == num_copies
def test_generate_checkboxes(datadir, tmpdir):
@pytest.mark.parametrize('checkboxes', [[(300, 100, 1, 'c'), (500, 50, 0, 'd'), (500, 500, 0, 'a'), (250, 200, 1, 'b')],
[], [(250, 100, 0, None)]])
def test_generate_checkboxes(datadir, tmpdir, checkboxes):
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')]
# 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
......
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