Skip to content

Commit

Permalink
Document skill unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Nov 8, 2023
1 parent 8fff657 commit 243b87d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,27 @@ To test that skill intents match as expected for all supported languages,
the skill's root directory
> - <test-file\> is a relative or absolute path to the resource test file, usually `test_intents.yaml`
> - The `--padacioso` flag can be added to test with Padacioso instead of Padatious for relevant intents
## Advanced Usage
In addition to convenient CLI methods, this package also provides test cases that
may be extended.

### Skill Unit Tests
`neon_minerva.tests.skill_unit_test_base` provides `SkillTestCase`, a class
that supplies boilerplate setup/teardown/mocking for testing a skill. An example
skill test implementation could look like:

```python
from os import environ
from neon_minerva.tests.skill_unit_test_base import SkillTestCase

environ['TEST_SKILL_ENTRYPOINT'] = "my_skill.test"

class MySkillTest(SkillTestCase):
def test_skill_init(self):
self.assertEqual(self.skill.skill_id, "my_skill.test")
...
```

Be sure to review the base class for mocked methods and test paths as these may
change in the future.

0 comments on commit 243b87d

Please sign in to comment.