Testing a Framework application is easy. Given that event handlers are plain Python functions that take arguments such asDocumentation Index
Fetch the complete documentation index at: https://dev.writer.com/llms.txt
Use this file to discover all available pages before exploring further.
state and payload, you can inject your own and test whether the outcome is correct. This section will use pytest examples.
State
Accessing the initial state
To get started, import your app’s entry point,main. This will initialise state and make event handlers available. The initial state is available in the module, at main.wf.initial_state provided you imported writer as wf.
Creating states
For testing purposes, you can create your own state using theWriterState class in writer.core. Pass a dictionary when constructing it.
Example
The code of a Framework application basically consists of two things:- Initial state
- Event handlers