Closed fivesails closed 5 years ago
Thank you for pointing this out, @fivesails. There are many layers of issues with this example. I've never gotten around to really going through this module, but I'd like to start using it to build out tests that use each of the modules. There have been several bugs introduced in the script as the core modules evolved. Definitely, the functions in core.items are add_item
and remove_item
. The when decorator does validation of the Items, but I'm not sure yet how the script worked before with the old decorator.
Please submit a PR with your fixes so that others don't bump into this. At some point in the future, I'll dig into this module and example.
When executed, a
ValueError: when: "Item TestNumber1 received update" could not be parsed because Item "TestNumber1" is not in the ItemRegistry
occurs. To Reproduce Steps to reproduce the behavior:/Script Examples/Python/testing_example.py
to the appropriate folderEnvironment (please complete the following information):
Additional context
@when
decorator is expanded before the unit test creates the items. If the creation of the Trigger is delayed, the unit test runs fine on my system. I attach that version: testing_2_example.py.txtcore.items
areadd_item()
isoadd()
andremove_item()
isoremove()
.