openhab-scripters / openhab-helper-libraries

Scripts and modules for use with openHAB
Eclipse Public License 1.0
88 stars 70 forks source link

Update testing_example.py #179

Closed fivesails closed 5 years ago

fivesails commented 5 years ago

Fixes #177

  1. There is only one test: the plural in the first comment is correctd to singular
  2. In the current version of the library, the methods in core.items are add_item() iso add() and remove_item() iso remove().
  3. The repository version, when executed, comes up with a ValueError: when: "Item TestNumber1 received update" could not be parsed because Item "TestNumber1" is not in the ItemRegistry I think, this error occurs because the @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.
  4. The items are not required and therefore removed from the files' first comment

Feel free to change.

5iver commented 5 years ago

https://www.openhab.org/docs/developer/contributing.html#sign-your-work

fivesails commented 5 years ago

Thank you Scott, both the GitHub Desktop and the command line show: git commit -S -m "Signed-off-by: Erik Martens<fivesails@web.de>" "Script Examples/Python/testing_example.py" Aborting commit due to empty commit message.

5iver commented 5 years ago

See here... https://help.github.com/en/articles/changing-a-commit-message.

5iver commented 5 years ago

You got the signoff in this one... https://github.com/openhab-scripters/openhab-helper-libraries/pull/179/commits/b8da93888d2f78a0cea13dffb42cc354c902a871. You'd typically rebase to put all of the commits into one, but that can be difficult if you're not familiar with git, so I can just squash them before the merge. If at least one commit has a signoff, it will carry through in the squashed commit. So, we're all good... thank you!

VS Code has git built in, but also has some really nice git extensions. For a simple commit from the web, just make sure you've got the signed-off-by at the bottom of the commit message. If you forget, you'll need to use a local repo to amend the commit.