mirror of
https://github.com/TheLocehiliosan/yadm
synced 2024-10-27 20:34:27 +00:00
Properly handle missing "." in alternate conditions
This commit is contained in:
parent
4ea3ed9e2a
commit
6d5467951a
@ -100,7 +100,8 @@ def test_alt_conditions(
|
||||
|
||||
|
||||
@pytest.mark.usefixtures('ds1_copy')
|
||||
@pytest.mark.parametrize('kind', ['builtin', '', 'envtpl', 'j2cli', 'j2'])
|
||||
@pytest.mark.parametrize(
|
||||
'kind', ['builtin', '', None, 'envtpl', 'j2cli', 'j2'])
|
||||
@pytest.mark.parametrize('label', ['t', 'template', 'yadm', ])
|
||||
def test_alt_templates(
|
||||
runner, paths, kind, label):
|
||||
@ -108,6 +109,8 @@ def test_alt_templates(
|
||||
yadm_dir = setup_standard_yadm_dir(paths)
|
||||
|
||||
suffix = f'##{label}.{kind}'
|
||||
if kind is None:
|
||||
suffix = f'##{label}'
|
||||
utils.create_alt_files(paths, suffix)
|
||||
run = runner([paths.pgm, '-Y', yadm_dir, 'alt'])
|
||||
assert run.success
|
||||
|
@ -59,7 +59,7 @@ def create_alt_files(paths, suffix,
|
||||
# Do not test directory support for jinja alternates
|
||||
test_paths = [new_file1, new_file2]
|
||||
test_names = [ALT_FILE1, ALT_FILE2]
|
||||
if not re.match(r'##(t|template|yadm)\.', suffix):
|
||||
if not re.match(r'##(t$|t\.|template|yadm)', suffix):
|
||||
test_paths += [new_dir]
|
||||
test_names += [ALT_DIR]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user