forked from dictation-toolbox/unimacro
-
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.
Merge branch 'fix_unimacro_basics' of github.com:dougransom/unimacro …
…into fix_unimacro_basics
- Loading branch information
Showing
5 changed files
with
49 additions
and
27 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
Empty file.
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
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#pylint:disable=E1101 | ||
from pathlib import Path | ||
import pytest | ||
import natlink | ||
from unimacro.UnimacroGrammars._tasks import ThisGrammar | ||
from natlinkcore import natlinkstatus | ||
status = natlinkstatus.NatlinkStatus | ||
|
||
thisDir = Path(__file__).parent | ||
|
||
def mock_unimacro_user_dir(_self): | ||
mock_folder= thisDir / "mock_unimacro_userdir" | ||
if not mock_folder.is_dir(): | ||
mock_folder.mkdir() | ||
return str(mock_folder) | ||
|
||
def test_gototask(monkeypatch): | ||
"""see if (with debugging) coming into a grammar works | ||
""" | ||
monkeypatch.setattr(status, "getUnimacroUserDirectory", mock_unimacro_user_dir) | ||
|
||
natlink.natConnect() | ||
try: | ||
thisGrammar = ThisGrammar() | ||
thisGrammar.startInifile() #modName = '_tasks') | ||
thisGrammar.initialize() | ||
Words = ['task', 'three'] | ||
# print(f'natbj.loadedGrammars: {natbj.loadedGrammars}') | ||
thisGrammar.rule_taskswitch(Words) | ||
# natlink.recognitionMimic(["task", "three"]) | ||
finally: | ||
natlink.natDisconnect() | ||
|
||
if __name__ == "__main__": | ||
pytest.main(['test_gototask']) |