diff options
author | Frederick Muriuki Muriithi | 2025-07-23 01:17:32 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2025-07-23 16:59:27 -0500 |
commit | d3c04823c3e9d2be0ac8f81f9266db3cdb509819 (patch) | |
tree | 2d330a27a9ae59a6c39f0736c22a5130304e5525 | |
parent | 7522a8eb4232a4fcb03c1af41b70e3f9c25702ca (diff) | |
download | gn-libs-d3c04823c3e9d2be0ac8f81f9266db3cdb509819.tar.gz |
Privileges-check specification parsing: add a new test.
Check that the parser reduces interleaved conditions into a simpler
tree, merging conditionals where appropriate.
-rw-r--r-- | tests/unit/test_privileges_spec_parsing.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/unit/test_privileges_spec_parsing.py b/tests/unit/test_privileges_spec_parsing.py index 7b563e1..7f80ed8 100644 --- a/tests/unit/test_privileges_spec_parsing.py +++ b/tests/unit/test_privileges_spec_parsing.py @@ -131,7 +131,10 @@ def test_invalid(spec): @pytest.mark.unit_test @pytest.mark.parametrize( "spec,expected", - ()) + (("(AND priv1 (or priv2 priv3) priv4 (and priv5 priv6))", + ("AND", + ("priv1", "priv4", "priv5", "priv6"), + ("OR", ("priv2", "priv3")))),)) def test_complex(spec, expected): """ GIVEN: An valid, but more complex specification |