Skip to content

Commit 69da4be

Browse files
committed
#69 - New tests to assert functionality
1 parent 4f612c7 commit 69da4be

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/core/entity_parsing/test_entity_fields/test_entity_parsing.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,21 +205,22 @@ class PyttmanIntentInternalEntityParserTestWebscraperApp(
205205
PyttmanInternalTestBaseCase
206206
):
207207
process_message = True
208-
mock_message = Message("Search for ManufacturerA ManufacturerB Model123 "
208+
mock_message = Message("monitor ManufacturerA ManufacturerB Model123 "
209209
"on page_a and page_b price 45000 60 results")
210210
expected_entities = {
211211
"manufacturer": "ManufacturerA ManufacturerB",
212212
"model": "Model123",
213213
"pages": ["page_a", "page_b"],
214214
"minimum_price": 45000,
215+
"create_monitor": True,
215216
"maximum_results": 60}
216217

217218
class IntentClass(ImplementedTestIntent):
218219
"""
219220
This test checks The TextEntityField, and asserts that the 'default'
220221
argument works as expected.
221222
"""
222-
lead = ("Search",)
223+
lead = ("monitor", "search")
223224
ignore_in_entities = ("search", "for", "on")
224225
manufacturer = TextEntityField(span=2)
225226
model = TextEntityField(prefixes=(manufacturer,))
@@ -230,6 +231,7 @@ class IntentClass(ImplementedTestIntent):
230231
prefixes=("price",))
231232
maximum_results = IntegerEntityField(suffixes=("results",),
232233
identifier=NumberIdentifier)
234+
create_monitor = BoolEntityField(message_contains=("monitor", "monitoring"))
233235

234236

235237
def get_valid_strings() -> tuple:
@@ -331,7 +333,7 @@ class PyttmanIntentInternalTestTrailAndLeadAreIgnored(
331333
mock_message = Message("Start workshift")
332334
process_message = True
333335
expected_entities = {
334-
"is_workshift": False,
336+
"is_workshift": True,
335337
"is_break": False
336338
}
337339

0 commit comments

Comments
 (0)