py_ask_sdk_test
This is a framework for testing Alexa Skills developed in Python with the alexa-skills-kit-sdk-for-python, which is mostly a translation of taimos' Alexa Skill Test Framework in Typescript, which itself is based on the alexa-skill-test-framework by Brian MacIntosh.
The framework uses assert to check the expected behaviour. So the best way to go is using it with pytest.
The ask-sdk version it is based on is ask-sdk-core=1.10, ask-sdk-runtime=1.10 and ask-sdk-model=1.11.
Install:
You can install the framework via pip:
pip install py_ask_sdk_test
Example:
You can see an example for using the framework in the following and in the framework's test-files:
from py_ask_sdk_test.alexa_test import AlexaTest
from py_ask_sdk_test.classes import TestItem, SkillSettings, SupportedInterfaces
from request_builders.launch_request_builder import LaunchRequestBuilder
from request_builders.intent_request_builder import IntentRequestBuilder
from pseudo_handler import handler
skill_settings = SkillSettings(app_id="<Your skill's id>",
user_id="<Your user id>",
device_id="<Your device id>",
locale="<The locale of your skill>",
interfaces=SupportedInterfaces()) # interfaces your skill supports (audio, video etc.)
def test_launch_request():
"""Tests the LaunchRequest's speech and repromt output"""
alexa_test = AlexaTest(handler)
alexa_test.test(
[
TestItem(
LaunchRequestBuilder(skill_settings).build(),
expected_speech="Salve, gaudeo te videre!",
expected_repromt="Vin aliquid dicere?",
check_question=False
),
TestItem(
IntentRequestBuilder("DeiIntent", skill_settings).build(),
expected_speech=(r"Jupiter.+", True),
expected_repromt="",
check_question=False
)
]
)
Metadata
Release files for py-ask-sdk-test 1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| py_ask_sdk_test-1.3.tar.gz | 10.5 kB | Without provenance | Details for py_ask_sdk_test-1.3.tar.gz |
Release files / py_ask_sdk_test-1.3.tar.gz
| Download URL | py_ask_sdk_test-1.3.tar.gz |
|---|---|
| Size | 10.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e0385ebf331fb28ae30534d6b4a779211340a8e8f200f2959e003f39e70ec624
|
|
BLAKE2b-256 checksum How to use checksums |
6082da390943ae7d5d2155a007be75d1e928ccd1391f85c99631b7367cece60b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.6.8
|
Security for py-ask-sdk-test 1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.