Skip to content
Snippets Groups Projects
Commit 601a008a authored by Frederik Hennig's avatar Frederik Hennig
Browse files

add tests for config sanitation

parent 15d5917a
1 merge request!2Refactor Configuration System & Extend Documentation
Pipeline #70732 passed with stages
in 1 minute and 21 seconds
from os import path
import pytest
from pystencilssfg import SourceFileGenerator
from pystencilssfg.config import (
SfgConfig,
OutputMode,
GLOBAL_NAMESPACE,
CommandLineParameters,
SfgConfigException
)
......@@ -54,6 +54,25 @@ def test_override():
assert cfg1.clang_format.binary == "bogus"
def test_sanitation():
cfg = SfgConfig()
cfg.extensions.header = ".hxx"
assert cfg.extensions.header == "hxx"
cfg.extensions.header = ".cxx"
assert cfg.extensions.header == "cxx"
cfg.clang_format.force = True
with pytest.raises(SfgConfigException):
cfg.clang_format.skip = True
cfg.clang_format.force = False
cfg.clang_format.skip = True
with pytest.raises(SfgConfigException):
cfg.clang_format.force = True
def test_from_commandline(sample_config_module):
from argparse import ArgumentParser
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment