forked from openhab/openhab-mycroft
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: force setup of skill, change to class properties
- Loading branch information
Showing
3 changed files
with
46 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,38 @@ | ||
# pylint: disable=missing-docstring | ||
from threading import Event | ||
from unittest.mock import Mock | ||
import pytest | ||
from ovos_skill_openhab import openHABSkill | ||
from ovos_plugin_manager.skills import find_skill_plugins | ||
from ovos_utils.fakebus import FakeBus | ||
# TODO: Mock settings path, set up fixtures | ||
|
||
|
||
def test_skill_is_a_valid_plugin(): | ||
assert "ovos-skill-openhab.mikejgray" in find_skill_plugins().keys() | ||
|
||
|
||
def test_no_config_calls_speak_dialog(): | ||
fake_bus = FakeBus() | ||
fake_bus.emitter = fake_bus.ee | ||
fake_bus.connected_event = Event() | ||
fake_bus.connected_event.set() | ||
fake_bus.run_forever() | ||
skill = openHABSkill(bus=fake_bus, settings={"host": "", "port": ""}, skill_id="ovos-skill-openhab.mikejgray") | ||
skill.speak_dialog = Mock() | ||
skill.speak_dialog.assert_called_with({}) | ||
|
||
|
||
def test_list_all_devices_from_demo(): | ||
fake_bus = FakeBus() | ||
fake_bus.emitter = fake_bus.ee | ||
fake_bus.connected_event = Event() | ||
fake_bus.connected_event.set() | ||
fake_bus.run_forever() | ||
skill = openHABSkill(bus=fake_bus, settings={"host": "localhost", "port": "8080"}, skill_id="ovos-skill-openhab.mikejgray") | ||
skill.speak_dialog = Mock() | ||
skill.speak_dialog.assert_not_called() | ||
|
||
|
||
if __name__ == "__main__": | ||
pytest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
VERSION_MAJOR = 2 | ||
VERSION_MINOR = 0 | ||
VERSION_BUILD = 0 | ||
VERSION_ALPHA = 0 | ||
VERSION_ALPHA = 0 |