diff options
author | Tim Harder <radhermit@gmail.com> | 2021-03-06 14:49:35 -0700 |
---|---|---|
committer | Tim Harder <radhermit@gmail.com> | 2021-03-06 14:49:35 -0700 |
commit | f0fc94042cd5a6d7f7c5d6850c2913e2251262c1 (patch) | |
tree | df735b84719a5272c5aa93ac9b179c0f2843641c /tests | |
parent | mangle: split gentoo-specific mangling into a separate mangler (diff) | |
download | pkgdev-f0fc94042cd5a6d7f7c5d6850c2913e2251262c1.tar.gz pkgdev-f0fc94042cd5a6d7f7c5d6850c2913e2251262c1.tar.bz2 pkgdev-f0fc94042cd5a6d7f7c5d6850c2913e2251262c1.zip |
tests: add more file mangling skip verification
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_mangle.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/test_mangle.py b/tests/test_mangle.py index 4de27e4..bd35961 100644 --- a/tests/test_mangle.py +++ b/tests/test_mangle.py @@ -23,12 +23,20 @@ class TestMangler: def test_skipped_file(self, tmp_path): paths = [(tmp_path / x) for x in ('file', 'file.patch')] - skip_regex = re.compile(r'.+\.patch$') + for p in paths: p.write_text('# comment') + # skip patch files + skip_regex = re.compile(r'.+\.patch$') mangled_paths = list(Mangler(map(str, paths), skip_regex=skip_regex)) assert mangled_paths == [str(tmp_path / 'file')] + for p in paths: + p.write_text('# comment') + # don't skip any files + mangled_paths = list(Mangler(map(str, paths))) + assert mangled_paths == list(map(str, paths)) + def test_nonmangled_file(self, tmp_path): path = tmp_path / 'file' path.write_text('# comment\n') |