Hi everyone,
I am currently migrating a basic bot from 1.10 to 2.3. Previously, python unit tests had been written to check that the right messages were dispatched and that the right events were triggered. After migrating the forms following the migration guide, these tests of course need a significant update. However, I can’t figure out how to properly “simulate” the form now that it is not a tangible python class.
Here is the link to 2 of the relevant (and working) 1.X tests and setup: https://pastebin.com/91yczU9R
Previously, the following function allowed us to get a list of event and message related to the FormAction execution.
def run_form(self, tracker: Tracker, domain: Optional[Dict[Text, Any]] = None): loop = asyncio.get_event_loop() self.events = loop.run_until_complete( self.form.run( dispatcher=self.dispatcher, tracker=tracker, domain=domain or {} ) )
Any tips on how to retrieve events and messages sent by a 2.X Form and its corresponding FormValidationAction in a unit test environment? Thank you for your time.