Bertrand Benjamin
67656c2cf1
Split in 3 categories - from "options" key build with default_config, file_config and cli options - from "subject" key build csv or quantity of subject - other in direct access from "direct_access" dictionnary inside the file_config
42 lines
1.1 KiB
Python
42 lines
1.1 KiB
Python
from bopytex.tasks import activate_corr_on, clean, compile_pdf, generate, join_pdfs
|
|
|
|
|
|
def test_build_task_generate():
|
|
template = "tpl_source.tex"
|
|
task = generate(template, {"subject": "01"}, output="source.tex")
|
|
assert task.action == "GENERATE"
|
|
assert task.args == {"subject": "01"}
|
|
assert task.deps == [template]
|
|
|
|
|
|
def test_build_task_activate_corr_on():
|
|
src = "source.tex"
|
|
task = activate_corr_on(src, meta={}, output="corr_source.tex")
|
|
assert task.action == "ACTIVATE_CORR"
|
|
assert task.args == {}
|
|
assert task.deps == [src]
|
|
|
|
|
|
def test_build_task_compile():
|
|
src = "source.tex"
|
|
task = compile_pdf(src, output="source.pdf")
|
|
assert task.action == "COMPILE"
|
|
assert task.args == {}
|
|
assert task.deps == [src]
|
|
|
|
|
|
def test_build_task_join():
|
|
pdfs = [f"{i}_source.pdf" for i in range(3)]
|
|
task = join_pdfs(pdfs, output="joined.pdf")
|
|
assert task.action == "JOIN"
|
|
assert task.args == {}
|
|
assert task.deps == pdfs
|
|
|
|
|
|
def test_build_task_clean():
|
|
files = ["source.aux", "source.log"]
|
|
task = clean(files)
|
|
assert task.action == "CLEAN"
|
|
assert task.args == {}
|
|
assert task.deps == files
|