Mercurial > piecrust2
diff tests/conftest.py @ 466:456db44dcc53
bake: Pass the config variants and values from the CLI to the baker.
TODO: add support for that for the processor pipeline.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sat, 11 Jul 2015 23:51:02 -0700 |
parents | c0700c6d9545 |
children | 95b77239c3b7 |
line wrap: on
line diff
--- a/tests/conftest.py Sat Jul 11 20:33:55 2015 -0700 +++ b/tests/conftest.py Sat Jul 11 23:51:02 2015 -0700 @@ -7,6 +7,7 @@ import pytest import yaml import colorama +from piecrust.app import apply_variant_and_values from piecrust.configuration import merge_dicts from .mockutil import mock_fs, mock_fs_scope @@ -174,7 +175,16 @@ with mock_fs_scope(fs): out_dir = fs.path('kitchen/_counter') app = fs.getApp() - baker = Baker(app, out_dir) + + variant = self.spec.get('config_variant') + values = self.spec.get('config_values') + if values is not None: + values = list(values.items()) + apply_variant_and_values(app, variant, values) + + baker = Baker(app, out_dir, + applied_config_variant=variant, + applied_config_values=values) record = baker.bake() if not record.success: