@@ -68,6 +68,37 @@ class IntentClass(ImplementedTestIntent):
6868 grass_color = TextEntityField (suffixes = ("grass" ,))
6969
7070
71+ class PyttmanIntentInternalEntityParserTestTwoTextFieldsWithPrefixes (
72+ PyttmanInternalTestBaseCase
73+ ):
74+ process_message = True
75+ mock_message = Message ("Adam and Eve were out walking on green grass" )
76+ expected_entities = {
77+ "person_one_fail" : None ,
78+ "person_one" : "Adam" ,
79+ "person_two" : "Eve" ,
80+ "grass_color" : "green"
81+ }
82+
83+ class IntentClass (ImplementedTestIntent ):
84+ """
85+ Test a combination of custom Identifier class for a TextEntityField
86+ with valid_strings, message_contains all in combinations.
87+ prefixed should denote that the entity isn't found.
88+ """
89+ valid_strings = ("Adam" , "Eve" )
90+ lead = ("walking" ,)
91+ person_one_fail = TextEntityField (identifier = CapitalizedIdentifier ,
92+ valid_strings = valid_strings ,
93+ prefixes = ("_prefix_" ,))
94+ person_one = TextEntityField (identifier = CapitalizedIdentifier ,
95+ valid_strings = valid_strings )
96+ person_two = TextEntityField (identifier = CapitalizedIdentifier ,
97+ valid_strings = valid_strings ,
98+ suffixes = ("were" ,))
99+ grass_color = TextEntityField (suffixes = ("grass" ,))
100+
101+
71102class PyttmanIntentInternalEntityParserTestBookKeeperApp (
72103 PyttmanInternalTestBaseCase
73104):
0 commit comments