comps: Add tests for CompsFilter

All use cases that are actually used by pungi-koji are tested. There is
missing coverage for

 * keeping only items with matching arch
 * not reindenting the file

These aren't currently used and should be removed in the future, but
there may be other tools depending on the comps_filter executable.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2018-04-06 10:10:17 +02:00
parent 7ea4c33d87
commit de231064b7
15 changed files with 844 additions and 6 deletions

View file

@ -44,11 +44,7 @@ def main():
f.filter_environments(opts.arch, opts.arch_only_environments)
if not opts.no_cleanup:
f.remove_empty_groups(keep_empty=opts.keep_empty_group)
f.filter_category_groups()
f.remove_empty_categories()
f.filter_environment_groups()
f.remove_empty_environments()
f.cleanup(opts.keep_empty_group)
if opts.remove_categories:
f.remove_categories()