Feat: arrange variables for templates
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
This commit is contained in:
@@ -27,7 +27,13 @@ def test_generate(template_path, jinja2_env):
|
||||
output = "output"
|
||||
|
||||
message = generate(
|
||||
args={"a": 2, "jinja2": {"environment": jinja2_env}},
|
||||
args={
|
||||
"options": {
|
||||
"direct_access": {"a": 2},
|
||||
"jinja2": {"environment": jinja2_env},
|
||||
},
|
||||
"subject": {},
|
||||
},
|
||||
deps=[template],
|
||||
output=output,
|
||||
)
|
||||
@@ -59,10 +65,18 @@ def test_generate_with_random(template_path_with_random, jinja2_env):
|
||||
import random
|
||||
|
||||
message = generate(
|
||||
args={"random": random, "jinja2": {"environment": jinja2_env}},
|
||||
args={
|
||||
"options": {
|
||||
"jinja2": {"environment": jinja2_env},
|
||||
"direct_access": {
|
||||
"random": random,
|
||||
}
|
||||
},
|
||||
"subject":{},
|
||||
},
|
||||
deps=[template],
|
||||
output=output,
|
||||
)
|
||||
)
|
||||
print(message.err)
|
||||
assert message.status == 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user