mirror of
https://github.com/JuanCanham/skill-desktop-launcher.git
synced 2024-11-25 01:50:09 +00:00
Add tests for launching applications
This commit is contained in:
parent
a869615d8e
commit
3cd6f03629
@ -19,4 +19,16 @@ def test_runner(skill, example, emitter, loader, m1):
|
|||||||
elif example.endswith('search.for.kittens.json'):
|
elif example.endswith('search.for.kittens.json'):
|
||||||
m.assert_called_with(SEARCH_BASE.format('youtube%20for%20kittens'))
|
m.assert_called_with(SEARCH_BASE.format('youtube%20for%20kittens'))
|
||||||
|
|
||||||
|
if example.endswith('launch.rocket.json'):
|
||||||
|
s.register_vocabulary('rocket', 'Application')
|
||||||
|
m = mock.Mock()
|
||||||
|
s.appmap['rocket'] = [m]
|
||||||
|
ret = SkillTest(skill, example, emitter).run(loader)
|
||||||
|
m.launch.assert_called_with()
|
||||||
|
elif example.endswith('open.notepad.json'):
|
||||||
|
s.register_vocabulary('notepad', 'Application')
|
||||||
|
m = mock.Mock()
|
||||||
|
s.appmap['notepad'] = [m]
|
||||||
|
ret = SkillTest(skill, example, emitter).run(loader)
|
||||||
|
m.launch.assert_called_with()
|
||||||
return ret
|
return ret
|
||||||
|
9
test/intent/launch.rocket.json
Normal file
9
test/intent/launch.rocket.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"utterance": "launch rocket",
|
||||||
|
"intent_type": "LaunchDesktopApplicationIntent",
|
||||||
|
"intent": {
|
||||||
|
"LaunchKeyword": "launch",
|
||||||
|
"Application": "rocket"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
8
test/intent/open.notepad.json
Normal file
8
test/intent/open.notepad.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"utterance": "open notepad",
|
||||||
|
"intent_type": "LaunchDesktopApplicationIntent",
|
||||||
|
"intent": {
|
||||||
|
"LaunchKeyword": "open",
|
||||||
|
"Application": "notepad"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user