From 6349038ce3edfc139ff33c02228a4c98a4740cd9 Mon Sep 17 00:00:00 2001 From: Antonio Cordero Balcazar Date: Fri, 24 Jul 2026 12:52:47 +0200 Subject: [PATCH] * Additional test for invalid wildcard detection. --- tests/tests_wildcards.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/tests_wildcards.py b/tests/tests_wildcards.py index 7558b17..0ef8895 100644 --- a/tests/tests_wildcards.py +++ b/tests/tests_wildcards.py @@ -2,6 +2,7 @@ from dataclasses import replace from ppp import PromptPostProcessor from ppp_classes import IFWILDCARDS_CHOICES +from ppp_logging import DEBUG_LEVEL from .base_tests import OutputTuple, InputTuple, TestPromptPostProcessorBase if __name__ == "__main__": @@ -128,6 +129,22 @@ class TestWildcards(TestPromptPostProcessorBase): interrupted=True, ) + def test_wc_load_invalid_wildcards(self): + self.wildcards_obj.refresh_wildcards( + DEBUG_LEVEL.full, + [], + """ +inv alid1: + - choice1 + - choice2 +inv.alid2: + - choice1 + - choice2 +""", + ) + self.assertFalse(self.wildcards_obj.get_wildcards("inv alid1"), "invalid wildcard name should not be accepted") + self.assertFalse(self.wildcards_obj.get_wildcards("inv.alid2"), "invalid wildcard name should not be accepted") + def test_wc_wildcard1a_text(self): # simple text wildcard self.process( InputTuple("the choices are: __text/wildcard1__", ""),