From ac58d5981213fdbb117f877b09550d5afa1fbe33 Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Mon, 13 Feb 2023 18:32:48 +0100 Subject: [PATCH] tests: fix arguments for foreign patching test --- rust2rpm/tests/test_generator.py | 76 +++++++++++++++++++++++++++++--- 1 file changed, 71 insertions(+), 5 deletions(-) diff --git a/rust2rpm/tests/test_generator.py b/rust2rpm/tests/test_generator.py index 69468c2..5fc9d0f 100644 --- a/rust2rpm/tests/test_generator.py +++ b/rust2rpm/tests/test_generator.py @@ -77,11 +77,77 @@ def test_spec_file_render(filename: str, target: str, tmp_path: Path): @pytest.mark.parametrize( - "filename,features,expected", [ - ("cxx-build-1.0.71.toml", [], "cxx-build-1.0.71.toml.patched"), - ("nix-0.24.1.toml", [], "nix-0.24.1.toml.patched"), - ("tokio-1.19.2.toml", [], "tokio-1.19.2.toml.patched"), - ] + "filename,features,expected", + [ + ( + "cxx-build-1.0.71.toml", + [ + "experimental-async-fn", + "parallel", + ], + "cxx-build-1.0.71.toml.patched", + ), + ( + "nix-0.24.1.toml", + [ + "acct", + "aio", + "default", + "dir", + "env", + "event", + "feature", + "fs", + "hostname", + "inotify", + "ioctl", + "kmod", + "mman", + "mount", + "mqueue", + "net", + "personality", + "poll", + "process", + "pthread", + "ptrace", + "quota", + "reboot", + "resource", + "sched", + "signal", + "socket", + "term", + "time", + "ucontext", + "uio", + "user", + "zerocopy", + ], + "nix-0.24.1.toml.patched", + ), + ( + "tokio-1.19.2.toml", + [ + "default", + "fs", + "full", + "io-std", + "io-util", + "macros", + "net", + "process", + "rt", + "rt-multi-thread", + "signal", + "stats", + "sync", + "test-util", + "time", + ], + "tokio-1.19.2.toml.patched", + ), + ], ) def test_drop_foreign_dependencies(filename: str, features: list[str], expected: str): before_path = resources.files("rust2rpm.tests.samples").joinpath(filename)