Skip to content

Instantly share code, notes, and snippets.

@jrwarwick
Last active May 11, 2018 23:08
Show Gist options
  • Save jrwarwick/b6cece82949fc5da14c6a75273b92b12 to your computer and use it in GitHub Desktop.
Save jrwarwick/b6cece82949fc5da14c6a75273b92b12 to your computer and use it in GitHub Desktop.
Generate Mycroft AI skill intent testing specs
cd /opt/mycroft/skills/$MYSKILLNAME
mkdir -p test/intent
cd test/intent
grep 'IntentBuilder(' ../../__init__.py | cat -n -- | sed 's/^\s\+\([0-9]\+\).*intent_handler(IntentBuilder("/00\1./ ; s/").*$/\.intent\.json/' | awk '$1'
echo '{
"utterance": "verbal imperative or interrogative after normalization",
"set_context": {"_TestRunner": "data", "test": ""},
"intent_type": "IntentObjectNameFromSkillPythonSource",
"intent": {
"parameter1Name": "expectedvalue1",
"parameter2Name": "expectedvalue2"
},
"expected_response": "expected response text regex .*"
}
' | tee `grep 'IntentBuilder(' ../../__init__.py | cat -n -- | sed 's/^\s\+\([0-9]\+\).*intent_handler(IntentBuilder("/00\1./ ; s/").*$/\.intent\.json/' | awk '$1'`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment